summary refs log tree commit diff
path: root/crypto/src/asn1/x509/X509Extensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x509/X509Extensions.cs')
-rw-r--r--crypto/src/asn1/x509/X509Extensions.cs28
1 files changed, 12 insertions, 16 deletions
diff --git a/crypto/src/asn1/x509/X509Extensions.cs b/crypto/src/asn1/x509/X509Extensions.cs
index 6396f9ddc..b5906c2e1 100644
--- a/crypto/src/asn1/x509/X509Extensions.cs
+++ b/crypto/src/asn1/x509/X509Extensions.cs
@@ -188,15 +188,14 @@ namespace Org.BouncyCastle.Asn1.X509
             new Dictionary<DerObjectIdentifier, X509Extension>();
         private readonly List<DerObjectIdentifier> m_ordering;
 
-        public static X509Extension GetExtension(X509Extensions extensions, DerObjectIdentifier oid)
-        {
-            return extensions?.GetExtension(oid);
-        }
+        public static X509Extension GetExtension(X509Extensions extensions, DerObjectIdentifier oid) =>
+            extensions?.GetExtension(oid);
 
-        public static Asn1Encodable GetExtensionParsedValue(X509Extensions extensions, DerObjectIdentifier oid)
-        {
-            return extensions?.GetExtensionParsedValue(oid);
-        }
+        public static Asn1Object GetExtensionParsedValue(X509Extensions extensions, DerObjectIdentifier oid) =>
+            extensions?.GetExtensionParsedValue(oid);
+
+        public static Asn1OctetString GetExtensionValue(X509Extensions extensions, DerObjectIdentifier oid) =>
+            extensions?.GetExtensionValue(oid);
 
 		public static X509Extensions GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
         {
@@ -316,10 +315,8 @@ namespace Org.BouncyCastle.Asn1.X509
          *
          * @return the extension if it's present, null otherwise.
          */
-        public X509Extension GetExtension(DerObjectIdentifier oid)
-        {
-            return CollectionUtilities.GetValueOrNull(m_extensions, oid);
-        }
+        public X509Extension GetExtension(DerObjectIdentifier oid) =>
+            CollectionUtilities.GetValueOrNull(m_extensions, oid);
 
         /**
          * return the parsed value of the extension represented by the object identifier
@@ -327,10 +324,9 @@ namespace Org.BouncyCastle.Asn1.X509
          *
          * @return the parsed value of the extension if it's present, null otherwise.
          */
-        public Asn1Encodable GetExtensionParsedValue(DerObjectIdentifier oid)
-        {
-            return GetExtension(oid)?.GetParsedValue();
-        }
+        public Asn1Object GetExtensionParsedValue(DerObjectIdentifier oid) => GetExtension(oid)?.GetParsedValue();
+
+        public Asn1OctetString GetExtensionValue(DerObjectIdentifier oid) => GetExtension(oid)?.Value;
 
 		/**
 		 * <pre>