diff options
Diffstat (limited to 'crypto/src/x509/PrincipalUtil.cs')
-rw-r--r-- | crypto/src/x509/PrincipalUtil.cs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/crypto/src/x509/PrincipalUtil.cs b/crypto/src/x509/PrincipalUtil.cs index fb1b01b40..22b0fd76e 100644 --- a/crypto/src/x509/PrincipalUtil.cs +++ b/crypto/src/x509/PrincipalUtil.cs @@ -1,3 +1,5 @@ +using System; + using Org.BouncyCastle.Asn1.X509; namespace Org.BouncyCastle.X509 @@ -10,24 +12,16 @@ namespace Org.BouncyCastle.X509 /// can be.</p> /// </remarks> // TODO[api] Make static + [Obsolete("Will be removed")] public class PrincipalUtilities { /// <summary>Return the issuer of the given cert as an X509Principal.</summary> - public static X509Name GetIssuerX509Principal(X509Certificate cert) - { - return cert.TbsCertificate.Issuer; - } + public static X509Name GetIssuerX509Principal(X509Certificate cert) => cert.IssuerDN; /// <summary>Return the subject of the given cert as an X509Principal.</summary> - public static X509Name GetSubjectX509Principal(X509Certificate cert) - { - return cert.TbsCertificate.Subject; - } + public static X509Name GetSubjectX509Principal(X509Certificate cert) => cert.SubjectDN; /// <summary>Return the issuer of the given CRL as an X509Principal.</summary> - public static X509Name GetIssuerX509Principal(X509Crl crl) - { - return crl.CertificateList.TbsCertList.Issuer; - } + public static X509Name GetIssuerX509Principal(X509Crl crl) => crl.IssuerDN; } } |