crypto-pubkey-types 0.4.2.3 → 0.4.3
raw patch · 2 files changed
+28/−1 lines, 2 filesdep +asn1-encodingPVP ok
version bump matches the API change (PVP)
Dependencies added: asn1-encoding
API changes (from Hackage documentation)
Files
- Crypto/Types/PubKey/RSA.hs +26/−0
- crypto-pubkey-types.cabal +2/−1
Crypto/Types/PubKey/RSA.hs view
@@ -18,6 +18,8 @@ import Data.Data import Data.ASN1.Types+import Data.ASN1.BinaryEncoding (BER(BER))+import Data.ASN1.Encoding (decodeASN1') import Data.Bits (shiftL, shiftR, complement, testBit, (.&.)) import Data.Word (Word8) @@ -44,6 +46,18 @@ -- some bad implementation will not serialize ASN.1 integer properly, leading -- to negative modulus. if that's the case, we correct it. modulus = toPositive smodulus+ fromASN1 ( Start Sequence+ : IntVal 0+ : Start Sequence+ : OID [1, 2, 840, 113549, 1, 1, 1]+ : Null+ : End Sequence+ : OctetString bs+ : xs+ ) = let inner = either strError fromASN1 $ decodeASN1' BER bs+ strError = Left .+ ("fromASN1: RSA.PublicKey: " ++) . show+ in either Left (\(k, _) -> Right (k, xs)) inner fromASN1 _ = Left "fromASN1: RSA.PublicKey: unexpected format" @@ -115,6 +129,18 @@ , private_qinv = pcoef } + fromASN1 ( Start Sequence+ : IntVal 0+ : Start Sequence+ : OID [1, 2, 840, 113549, 1, 1, 1]+ : Null+ : End Sequence+ : OctetString bs+ : xs+ ) = let inner = either strError fromASN1 $ decodeASN1' BER bs+ strError = Left .+ ("fromASN1: RSA.PrivateKey: " ++) . show+ in either Left (\(k, _) -> Right (k, xs)) inner fromASN1 _ = Left "fromASN1: RSA.PrivateKey: unexpected format"
crypto-pubkey-types.cabal view
@@ -1,5 +1,5 @@ Name: crypto-pubkey-types-Version: 0.4.2.3+Version: 0.4.3 Description: Generic cryptography public keys algorithm types License: BSD3 License-file: LICENSE@@ -20,6 +20,7 @@ Crypto.Types.PubKey.ECDSA Build-depends: base >= 4 && < 5 , asn1-types >= 0.1 && < 0.4+ , asn1-encoding source-repository head type: git