diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-19 16:18:31 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-19 16:18:31 +0700 |
commit | c806df63e3df05eeeb9bf9523528930f5aea36ba (patch) | |
tree | cde87e1526ed04d69bc61b41364f41e8ff031506 /crypto/src/pkix | |
parent | Refactoring in Cms (diff) | |
download | BouncyCastle.NET-ed25519-c806df63e3df05eeeb9bf9523528930f5aea36ba.tar.xz |
Refactoring around SubjectPublicKeyInfo
Diffstat (limited to 'crypto/src/pkix')
-rw-r--r-- | crypto/src/pkix/PkixCertPathValidatorUtilities.cs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs index 8d615b488..32b00503e 100644 --- a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs +++ b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs @@ -210,20 +210,17 @@ namespace Org.BouncyCastle.Pkix return cert.SubjectDN.Equivalent(cert.IssuerDN, true); } - internal static AlgorithmIdentifier GetAlgorithmIdentifier( - AsymmetricKeyParameter key) - { - try - { - SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(key); - - return info.AlgorithmID; - } - catch (Exception e) - { - throw new PkixCertPathValidatorException("Subject public key cannot be decoded.", e); - } - } + internal static AlgorithmIdentifier GetAlgorithmIdentifier(AsymmetricKeyParameter key) + { + try + { + return SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(key).Algorithm; + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Subject public key cannot be decoded.", e); + } + } internal static bool IsAnyPolicy(ISet<string> policySet) { |