diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-20 01:05:05 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-20 01:05:05 +0700 |
commit | aac29ea7c78c14d97a9d3b2f2a91e28750dd7bba (patch) | |
tree | 0f07b214366a3efbc71e8965b15284c27d41594d /crypto/src/openpgp/PgpUtilities.cs | |
parent | Mark several EC multipliers as obsolete (diff) | |
download | BouncyCastle.NET-ed25519-aac29ea7c78c14d97a9d3b2f2a91e28750dd7bba.tar.xz |
PGP updates from bc-java
Diffstat (limited to '')
-rw-r--r-- | crypto/src/openpgp/PgpUtilities.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/src/openpgp/PgpUtilities.cs b/crypto/src/openpgp/PgpUtilities.cs index a3efd591f..fd5ab6232 100644 --- a/crypto/src/openpgp/PgpUtilities.cs +++ b/crypto/src/openpgp/PgpUtilities.cs @@ -27,17 +27,20 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp try { - Asn1Sequence s = (Asn1Sequence) Asn1Object.FromByteArray(encoding); + Asn1Sequence s = Asn1Sequence.GetInstance(encoding); - i1 = (DerInteger) s[0]; - i2 = (DerInteger) s[1]; + i1 = DerInteger.GetInstance(s[0]); + i2 = DerInteger.GetInstance(s[1]); } - catch (IOException e) + catch (Exception e) { throw new PgpException("exception encoding signature", e); } - return new MPInteger[]{ new MPInteger(i1.Value), new MPInteger(i2.Value) }; + return new MPInteger[]{ + new MPInteger(i1.Value), + new MPInteger(i2.Value) + }; } public static MPInteger[] RsaSigToMpi( |