diff options
Diffstat (limited to 'crypto/src/asn1/x509/CRLDistPoint.cs')
-rw-r--r-- | crypto/src/asn1/x509/CRLDistPoint.cs | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/crypto/src/asn1/x509/CRLDistPoint.cs b/crypto/src/asn1/x509/CRLDistPoint.cs index 56ba79ca5..446bb19db 100644 --- a/crypto/src/asn1/x509/CRLDistPoint.cs +++ b/crypto/src/asn1/x509/CRLDistPoint.cs @@ -8,32 +8,28 @@ namespace Org.BouncyCastle.Asn1.X509 public class CrlDistPoint : Asn1Encodable { - internal readonly Asn1Sequence seq; - - public static CrlDistPoint GetInstance( - Asn1TaggedObject obj, - bool explicitly) + public static CrlDistPoint GetInstance(Asn1TaggedObject obj, bool explicitly) { return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); } - public static CrlDistPoint GetInstance( - object obj) + public static CrlDistPoint GetInstance(object obj) { - if (obj is CrlDistPoint || obj == null) - { - return (CrlDistPoint) obj; - } + if (obj is CrlDistPoint) + return (CrlDistPoint)obj; + if (obj == null) + return null; + return new CrlDistPoint(Asn1Sequence.GetInstance(obj)); + } - if (obj is Asn1Sequence) - { - return new CrlDistPoint((Asn1Sequence) obj); - } + public static CrlDistPoint FromExtensions(X509Extensions extensions) + { + return GetInstance(X509Extensions.GetExtensionParsedValue(extensions, X509Extensions.CrlDistributionPoints)); + } - throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); - } + internal readonly Asn1Sequence seq; - private CrlDistPoint( + private CrlDistPoint( Asn1Sequence seq) { this.seq = seq; |