diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-20 01:37:07 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-20 01:37:07 +0700 |
commit | 765426a8dc1fe20295f91d55e7bbf539e6b831fc (patch) | |
tree | 8e62ef9b9f45be2030ff490bd09834f2fb4df7a5 /crypto/src/asn1/pkcs | |
parent | Mark methods as "Var" for clarity (diff) | |
download | BouncyCastle.NET-ed25519-765426a8dc1fe20295f91d55e7bbf539e6b831fc.tar.xz |
Misc. updates from bc-java
Diffstat (limited to 'crypto/src/asn1/pkcs')
-rw-r--r-- | crypto/src/asn1/pkcs/CertBag.cs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/crypto/src/asn1/pkcs/CertBag.cs b/crypto/src/asn1/pkcs/CertBag.cs index e561fb890..61165c087 100644 --- a/crypto/src/asn1/pkcs/CertBag.cs +++ b/crypto/src/asn1/pkcs/CertBag.cs @@ -5,17 +5,25 @@ namespace Org.BouncyCastle.Asn1.Pkcs public class CertBag : Asn1Encodable { -// private readonly Asn1Sequence seq; + public static CertBag GetInstance(object obj) + { + if (obj is CertBag) + return (CertBag)obj; + if (obj == null) + return null; + return new CertBag(Asn1Sequence.GetInstance(obj)); + } + private readonly DerObjectIdentifier certID; private readonly Asn1Object certValue; + [Obsolete("Use 'GetInstance' instead")] public CertBag( Asn1Sequence seq) { if (seq.Count != 2) throw new ArgumentException("Wrong number of elements in sequence", "seq"); -// this.seq = seq; this.certID = DerObjectIdentifier.GetInstance(seq[0]); this.certValue = Asn1TaggedObject.GetInstance(seq[1]).GetObject(); } @@ -28,12 +36,12 @@ namespace Org.BouncyCastle.Asn1.Pkcs this.certValue = certValue; } - public DerObjectIdentifier CertID + public virtual DerObjectIdentifier CertID { get { return certID; } } - public Asn1Object CertValue + public virtual Asn1Object CertValue { get { return certValue; } } |