summary refs log tree commit diff
path: root/crypto/src/asn1/cmp/OobCert.cs
blob: 6d60f6bb64793f1282b6a8490697258235f5ab08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;

using Org.BouncyCastle.Asn1.X509;

namespace Org.BouncyCastle.Asn1.Cmp
{
    /**
     * OOBCert ::= CMPCertificate
     */
    public class OobCert
        : CmpCertificate
    {
        public static new OobCert GetInstance(object obj)
        {
            if (obj == null)
                return null;
            if (obj is OobCert oobCert)
                return oobCert;
            if (obj is CmpCertificate cmpCertificate)
                return new OobCert(cmpCertificate);
            if (obj is Asn1TaggedObject taggedObject)
                return new OobCert(taggedObject);
            return new OobCert(X509CertificateStructure.GetInstance(obj));
        }

        public static new OobCert GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
        {
            return Asn1Utilities.GetInstanceFromChoice(taggedObject, declaredExplicit, GetInstance);
        }

        [Obsolete("Use constructor from Asn1TaggedObject instead")]
        public OobCert(int type, Asn1Encodable otherCert)
            : base(type, otherCert)
        {
        }

        internal OobCert(Asn1TaggedObject taggedObject)
            : base(taggedObject)
        {
        }

        internal OobCert(CmpCertificate other)
            : base(other)
        {
        }

        public OobCert(X509CertificateStructure x509v3PKCert)
            : base(x509v3PKCert)
        {
        }
    }
}