Org.BouncyCastle.X509.X509Certificate.GetPublicKey C# (CSharp) Method

GetPublicKey() public method

Get the public key of the subject of the certificate.
public GetPublicKey ( ) : AsymmetricKeyParameter
return AsymmetricKeyParameter
        public virtual AsymmetricKeyParameter GetPublicKey()
        {
            return PublicKeyFactory.CreateKey(c.SubjectPublicKeyInfo);
        }

Usage Example

Example #1
0
		public virtual bool IsSignedBy(X509Certificate potentialIssuer)
		{
			try
			{
				GetCertificate().Verify(potentialIssuer.GetPublicKey());
				return true;
			}
			catch (InvalidKeyException)
			{
				return false;
			}
			catch (CertificateException)
			{
				return false;
			}
			catch (NoSuchAlgorithmException)
			{
				return false;
			}
			/*catch (NoSuchProviderException e)
			{
				throw new RuntimeException(e);
			}*/
			catch (SignatureException)
			{
				return false;
			}
		}
All Usage Examples Of Org.BouncyCastle.X509.X509Certificate::GetPublicKey