示例#1
0
 /// <inheritdoc />
 public byte[] Export(CryptographicPrivateKeyBlobType blobType)
 {
     try
     {
         return(KeyFormatter.GetFormatter(blobType).Write(KeyFormatter.ToPCLParameters(this.key.ExportParameters(true))));
     }
     catch (CryptographicException ex)
     {
         throw new InvalidOperationException("Private key not available.", ex);
     }
 }
示例#2
0
 /// <inheritdoc />
 public byte[] ExportPublicKey(CryptographicPublicKeyBlobType blobType)
 {
     return(KeyFormatter.GetFormatter(blobType).Write(KeyFormatter.ToPCLParameters(this.key.ExportParameters(false))));
 }