diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-04 21:20:26 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-04 21:20:26 +0700 |
commit | aa027f072fe8f7871950cd256b2e04f12c1d4551 (patch) | |
tree | 47c4bb1a5b813f7cb82a68ed6b87f431d075a97a /crypto/src/asn1/x509/TBSCertificateStructure.cs | |
parent | Add constructor from template CRL (diff) | |
download | BouncyCastle.NET-ed25519-aa027f072fe8f7871950cd256b2e04f12c1d4551.tar.xz |
X509: generation/validation of alternative signatures for certs and CRLs.
Diffstat (limited to 'crypto/src/asn1/x509/TBSCertificateStructure.cs')
-rw-r--r-- | crypto/src/asn1/x509/TBSCertificateStructure.cs | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/crypto/src/asn1/x509/TBSCertificateStructure.cs b/crypto/src/asn1/x509/TBSCertificateStructure.cs index e1fba2488..e41224f4a 100644 --- a/crypto/src/asn1/x509/TBSCertificateStructure.cs +++ b/crypto/src/asn1/x509/TBSCertificateStructure.cs @@ -39,27 +39,21 @@ namespace Org.BouncyCastle.Asn1.X509 internal DerBitString subjectUniqueID; internal X509Extensions extensions; - public static TbsCertificateStructure GetInstance( - Asn1TaggedObject obj, - bool explicitly) - { - return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); - } - - public static TbsCertificateStructure GetInstance( - object obj) - { - if (obj is TbsCertificateStructure) - return (TbsCertificateStructure) obj; - - if (obj != null) - return new TbsCertificateStructure(Asn1Sequence.GetInstance(obj)); + public static TbsCertificateStructure GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is TbsCertificateStructure tbsCertificateStructure) + return tbsCertificateStructure; + return new TbsCertificateStructure(Asn1Sequence.GetInstance(obj)); + } - return null; - } + public static TbsCertificateStructure GetInstance(Asn1TaggedObject obj, bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } - internal TbsCertificateStructure( - Asn1Sequence seq) + private TbsCertificateStructure(Asn1Sequence seq) { int seqStart = 0; |