diff --git a/ChangeLog.txt b/ChangeLog.txt index 0f92979c..2439ebd2 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,11 @@ ChangeLog for jsrsasign +restore KJUR.crypto.Cipher class without RSA/RSAOAEP support +* Changes from 11.0.0 to 11.1.0 (2024-Feb-01) + - src/crypto.js + - restore KJUR.crypto.Cipher class without RSA and RSAOAEP encryption/decryption support + remove RSA and RSAOAEP encryption for Marvin attack * Changes from 10.9.0 to 11.0.0 (2024-Jan-16) - remove RSA PKCS#1.5 end OAEP encryption/decryption for Marvin attack (#598) diff --git a/api/files.html b/api/files.html index 69e38753..e84635b3 100644 --- a/api/files.html +++ b/api/files.html @@ -482,6 +482,8 @@

Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • @@ -704,7 +706,7 @@

    crypto-1.1.js

    Version:
    -
    jsrsasign 11.0.0 crypto 2.0.0 (2024-Jan-16)
    +
    jsrsasign 11.1.0 crypto 2.1.0 (2024-Feb-01)
    diff --git a/api/index.html b/api/index.html index 0535de4d..d43a0970 100644 --- a/api/index.html +++ b/api/index.html @@ -482,6 +482,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • @@ -1410,6 +1412,12 @@

    KJUR.crypto


    +
    +

    KJUR.crypto.Cipher

    + Cipher class to encrypt and decrypt data
    +
    +
    +

    KJUR.crypto.DSA

    class for DSA signing and verifcation diff --git a/api/symbols/ASN1HEX.html b/api/symbols/ASN1HEX.html index 97b3f9c2..577e7f24 100644 --- a/api/symbols/ASN1HEX.html +++ b/api/symbols/ASN1HEX.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/Base64x.html b/api/symbols/Base64x.html index ad1f04d8..f546f5dc 100644 --- a/api/symbols/Base64x.html +++ b/api/symbols/Base64x.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KEYUTIL.html b/api/symbols/KEYUTIL.html index a3774d33..5a7e043b 100644 --- a/api/symbols/KEYUTIL.html +++ b/api/symbols/KEYUTIL.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ASN1Object.html b/api/symbols/KJUR.asn1.ASN1Object.html index a302e005..00e3eed0 100644 --- a/api/symbols/KJUR.asn1.ASN1Object.html +++ b/api/symbols/KJUR.asn1.ASN1Object.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ASN1Util.html b/api/symbols/KJUR.asn1.ASN1Util.html index 6d11786f..1c3dba66 100644 --- a/api/symbols/KJUR.asn1.ASN1Util.html +++ b/api/symbols/KJUR.asn1.ASN1Util.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractString.html b/api/symbols/KJUR.asn1.DERAbstractString.html index 3355fc45..c6668cf5 100644 --- a/api/symbols/KJUR.asn1.DERAbstractString.html +++ b/api/symbols/KJUR.asn1.DERAbstractString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractStructured.html b/api/symbols/KJUR.asn1.DERAbstractStructured.html index 4f4beba2..2f40b1dc 100644 --- a/api/symbols/KJUR.asn1.DERAbstractStructured.html +++ b/api/symbols/KJUR.asn1.DERAbstractStructured.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractTime.html b/api/symbols/KJUR.asn1.DERAbstractTime.html index 488eebb9..95b633db 100644 --- a/api/symbols/KJUR.asn1.DERAbstractTime.html +++ b/api/symbols/KJUR.asn1.DERAbstractTime.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERBMPString.html b/api/symbols/KJUR.asn1.DERBMPString.html index d8d771e3..143ec9db 100644 --- a/api/symbols/KJUR.asn1.DERBMPString.html +++ b/api/symbols/KJUR.asn1.DERBMPString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERBitString.html b/api/symbols/KJUR.asn1.DERBitString.html index 59d8934f..96400c32 100644 --- a/api/symbols/KJUR.asn1.DERBitString.html +++ b/api/symbols/KJUR.asn1.DERBitString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERBoolean.html b/api/symbols/KJUR.asn1.DERBoolean.html index 0a996cd9..9809f00c 100644 --- a/api/symbols/KJUR.asn1.DERBoolean.html +++ b/api/symbols/KJUR.asn1.DERBoolean.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DEREnumerated.html b/api/symbols/KJUR.asn1.DEREnumerated.html index a401a74c..3485f2cd 100644 --- a/api/symbols/KJUR.asn1.DEREnumerated.html +++ b/api/symbols/KJUR.asn1.DEREnumerated.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERGeneralizedTime.html b/api/symbols/KJUR.asn1.DERGeneralizedTime.html index 56b1bded..bede56a6 100644 --- a/api/symbols/KJUR.asn1.DERGeneralizedTime.html +++ b/api/symbols/KJUR.asn1.DERGeneralizedTime.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERIA5String.html b/api/symbols/KJUR.asn1.DERIA5String.html index d2a16352..eb850933 100644 --- a/api/symbols/KJUR.asn1.DERIA5String.html +++ b/api/symbols/KJUR.asn1.DERIA5String.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERInteger.html b/api/symbols/KJUR.asn1.DERInteger.html index 1108dd80..e147cf5f 100644 --- a/api/symbols/KJUR.asn1.DERInteger.html +++ b/api/symbols/KJUR.asn1.DERInteger.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERNull.html b/api/symbols/KJUR.asn1.DERNull.html index 13b6ddca..51bd2cac 100644 --- a/api/symbols/KJUR.asn1.DERNull.html +++ b/api/symbols/KJUR.asn1.DERNull.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERNumericString.html b/api/symbols/KJUR.asn1.DERNumericString.html index d80550a3..d4636733 100644 --- a/api/symbols/KJUR.asn1.DERNumericString.html +++ b/api/symbols/KJUR.asn1.DERNumericString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERObjectIdentifier.html b/api/symbols/KJUR.asn1.DERObjectIdentifier.html index 0fbb8d81..a2540b30 100644 --- a/api/symbols/KJUR.asn1.DERObjectIdentifier.html +++ b/api/symbols/KJUR.asn1.DERObjectIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DEROctetString.html b/api/symbols/KJUR.asn1.DEROctetString.html index 72fb4e50..8eff1f73 100644 --- a/api/symbols/KJUR.asn1.DEROctetString.html +++ b/api/symbols/KJUR.asn1.DEROctetString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERPrintableString.html b/api/symbols/KJUR.asn1.DERPrintableString.html index 723449d7..0c35b29d 100644 --- a/api/symbols/KJUR.asn1.DERPrintableString.html +++ b/api/symbols/KJUR.asn1.DERPrintableString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERSequence.html b/api/symbols/KJUR.asn1.DERSequence.html index e84a8f64..ca699a0d 100644 --- a/api/symbols/KJUR.asn1.DERSequence.html +++ b/api/symbols/KJUR.asn1.DERSequence.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERSet.html b/api/symbols/KJUR.asn1.DERSet.html index 5cf28169..8b846d5f 100644 --- a/api/symbols/KJUR.asn1.DERSet.html +++ b/api/symbols/KJUR.asn1.DERSet.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERTaggedObject.html b/api/symbols/KJUR.asn1.DERTaggedObject.html index cd688eaf..29e84d2e 100644 --- a/api/symbols/KJUR.asn1.DERTaggedObject.html +++ b/api/symbols/KJUR.asn1.DERTaggedObject.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERTeletexString.html b/api/symbols/KJUR.asn1.DERTeletexString.html index ff7778f5..568579f6 100644 --- a/api/symbols/KJUR.asn1.DERTeletexString.html +++ b/api/symbols/KJUR.asn1.DERTeletexString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERUTCTime.html b/api/symbols/KJUR.asn1.DERUTCTime.html index e501eff3..2141e3f9 100644 --- a/api/symbols/KJUR.asn1.DERUTCTime.html +++ b/api/symbols/KJUR.asn1.DERUTCTime.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERUTF8String.html b/api/symbols/KJUR.asn1.DERUTF8String.html index 3d60f24f..63093bdc 100644 --- a/api/symbols/KJUR.asn1.DERUTF8String.html +++ b/api/symbols/KJUR.asn1.DERUTF8String.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.DERVisibleString.html b/api/symbols/KJUR.asn1.DERVisibleString.html index fecac4da..cfb0fac9 100644 --- a/api/symbols/KJUR.asn1.DERVisibleString.html +++ b/api/symbols/KJUR.asn1.DERVisibleString.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.CAdESUtil.html b/api/symbols/KJUR.asn1.cades.CAdESUtil.html index c9649c2e..724729cd 100644 --- a/api/symbols/KJUR.asn1.cades.CAdESUtil.html +++ b/api/symbols/KJUR.asn1.cades.CAdESUtil.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html index 5626e11c..04e54d3a 100644 --- a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html +++ b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherCertID.html b/api/symbols/KJUR.asn1.cades.OtherCertID.html index 44064e6e..13d7dc57 100644 --- a/api/symbols/KJUR.asn1.cades.OtherCertID.html +++ b/api/symbols/KJUR.asn1.cades.OtherCertID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHash.html b/api/symbols/KJUR.asn1.cades.OtherHash.html index cc3b7ce0..4f399981 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHash.html +++ b/api/symbols/KJUR.asn1.cades.OtherHash.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html index 74c33ff5..af32ea79 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashValue.html b/api/symbols/KJUR.asn1.cades.OtherHashValue.html index 58162e3d..97d41780 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashValue.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html index e236a3b0..a251f773 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html index 43879510..c0e6f6c0 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html index 9657f395..eb227864 100644 --- a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html +++ b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cades.html b/api/symbols/KJUR.asn1.cades.html index 0f2ffe33..00339077 100644 --- a/api/symbols/KJUR.asn1.cades.html +++ b/api/symbols/KJUR.asn1.cades.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.Attribute.html b/api/symbols/KJUR.asn1.cms.Attribute.html index 68dc72a6..47a35cc8 100644 --- a/api/symbols/KJUR.asn1.cms.Attribute.html +++ b/api/symbols/KJUR.asn1.cms.Attribute.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.AttributeList.html b/api/symbols/KJUR.asn1.cms.AttributeList.html index bc026395..e04f3751 100644 --- a/api/symbols/KJUR.asn1.cms.AttributeList.html +++ b/api/symbols/KJUR.asn1.cms.AttributeList.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.CMSParser.html b/api/symbols/KJUR.asn1.cms.CMSParser.html index 15fe5914..a1857b3a 100644 --- a/api/symbols/KJUR.asn1.cms.CMSParser.html +++ b/api/symbols/KJUR.asn1.cms.CMSParser.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.CMSUtil.html b/api/symbols/KJUR.asn1.cms.CMSUtil.html index 4d6144ed..96e7c5c7 100644 --- a/api/symbols/KJUR.asn1.cms.CMSUtil.html +++ b/api/symbols/KJUR.asn1.cms.CMSUtil.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.CertificateSet.html b/api/symbols/KJUR.asn1.cms.CertificateSet.html index d11a0554..0ed47b11 100644 --- a/api/symbols/KJUR.asn1.cms.CertificateSet.html +++ b/api/symbols/KJUR.asn1.cms.CertificateSet.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentInfo.html b/api/symbols/KJUR.asn1.cms.ContentInfo.html index ce09829c..16124b1f 100644 --- a/api/symbols/KJUR.asn1.cms.ContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.ContentInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentType.html b/api/symbols/KJUR.asn1.cms.ContentType.html index aa8b8727..2a31f8ae 100644 --- a/api/symbols/KJUR.asn1.cms.ContentType.html +++ b/api/symbols/KJUR.asn1.cms.ContentType.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.ESSCertID.html b/api/symbols/KJUR.asn1.cms.ESSCertID.html index af07f1de..6215d733 100644 --- a/api/symbols/KJUR.asn1.cms.ESSCertID.html +++ b/api/symbols/KJUR.asn1.cms.ESSCertID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html b/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html index 23dd069c..971a91a4 100644 --- a/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html +++ b/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html index 0bb8c903..fdebc5da 100644 --- a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html index 2c866015..3c5bcf07 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html +++ b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerSerial.html b/api/symbols/KJUR.asn1.cms.IssuerSerial.html index c2078610..76f6f4e6 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerSerial.html +++ b/api/symbols/KJUR.asn1.cms.IssuerSerial.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.MessageDigest.html b/api/symbols/KJUR.asn1.cms.MessageDigest.html index bd1f5b53..4c778dd1 100644 --- a/api/symbols/KJUR.asn1.cms.MessageDigest.html +++ b/api/symbols/KJUR.asn1.cms.MessageDigest.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html b/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html index 6b394aaf..2a085e26 100644 --- a/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html +++ b/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html b/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html index b7428607..6318ae69 100644 --- a/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html +++ b/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html b/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html index ea188996..e3097d27 100644 --- a/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html +++ b/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SignedData.html b/api/symbols/KJUR.asn1.cms.SignedData.html index d0b8f25e..5fb3581c 100644 --- a/api/symbols/KJUR.asn1.cms.SignedData.html +++ b/api/symbols/KJUR.asn1.cms.SignedData.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerIdentifier.html b/api/symbols/KJUR.asn1.cms.SignerIdentifier.html index 2f5d2b0b..182206a5 100644 --- a/api/symbols/KJUR.asn1.cms.SignerIdentifier.html +++ b/api/symbols/KJUR.asn1.cms.SignerIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerInfo.html b/api/symbols/KJUR.asn1.cms.SignerInfo.html index ad79a684..95038f08 100644 --- a/api/symbols/KJUR.asn1.cms.SignerInfo.html +++ b/api/symbols/KJUR.asn1.cms.SignerInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificate.html b/api/symbols/KJUR.asn1.cms.SigningCertificate.html index 760085c7..1941bb98 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificate.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificate.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html index 40fbd3d3..d7eba409 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningTime.html b/api/symbols/KJUR.asn1.cms.SigningTime.html index 67cdc34a..306bd429 100644 --- a/api/symbols/KJUR.asn1.cms.SigningTime.html +++ b/api/symbols/KJUR.asn1.cms.SigningTime.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html b/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html index 25b786c7..f98abc54 100644 --- a/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.cms.html b/api/symbols/KJUR.asn1.cms.html index 5ee9b982..0cf96989 100644 --- a/api/symbols/KJUR.asn1.cms.html +++ b/api/symbols/KJUR.asn1.cms.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.csr.CSRUtil.html b/api/symbols/KJUR.asn1.csr.CSRUtil.html index 7893b470..3918cf26 100644 --- a/api/symbols/KJUR.asn1.csr.CSRUtil.html +++ b/api/symbols/KJUR.asn1.csr.CSRUtil.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequest.html b/api/symbols/KJUR.asn1.csr.CertificationRequest.html index 42a747d6..ed15f722 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequest.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequest.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html index d62dd130..07c5ed26 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.csr.html b/api/symbols/KJUR.asn1.csr.html index 28f91a87..85b80585 100644 --- a/api/symbols/KJUR.asn1.csr.html +++ b/api/symbols/KJUR.asn1.csr.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.html b/api/symbols/KJUR.asn1.html index ea829e79..ddef8ebd 100644 --- a/api/symbols/KJUR.asn1.html +++ b/api/symbols/KJUR.asn1.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html b/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html index 8a26a199..dda6b53c 100644 --- a/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertID.html b/api/symbols/KJUR.asn1.ocsp.CertID.html index cbff375d..57be6ca5 100644 --- a/api/symbols/KJUR.asn1.ocsp.CertID.html +++ b/api/symbols/KJUR.asn1.ocsp.CertID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertStatus.html b/api/symbols/KJUR.asn1.ocsp.CertStatus.html index ac5beddb..ac286eb3 100644 --- a/api/symbols/KJUR.asn1.ocsp.CertStatus.html +++ b/api/symbols/KJUR.asn1.ocsp.CertStatus.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPParser.html b/api/symbols/KJUR.asn1.ocsp.OCSPParser.html index 5a9fceb4..80c6ee44 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPParser.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPParser.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html index 1947af5b..3913129f 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html b/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html index cb364459..a7b2971f 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html index f725e943..6a822b42 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.Request.html b/api/symbols/KJUR.asn1.ocsp.Request.html index f3737006..88d5f1dc 100644 --- a/api/symbols/KJUR.asn1.ocsp.Request.html +++ b/api/symbols/KJUR.asn1.ocsp.Request.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponderID.html b/api/symbols/KJUR.asn1.ocsp.ResponderID.html index 98f9d9af..309f6ace 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponderID.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponderID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html b/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html index e1e38296..39561c40 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponseData.html b/api/symbols/KJUR.asn1.ocsp.ResponseData.html index 94caf0fc..17c50fa1 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponseData.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponseData.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.SingleResponse.html b/api/symbols/KJUR.asn1.ocsp.SingleResponse.html index e9155e9e..98dfce1e 100644 --- a/api/symbols/KJUR.asn1.ocsp.SingleResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.SingleResponse.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html b/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html index 2b47a02d..0fd78fa1 100644 --- a/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html +++ b/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html index fa1c6df2..a29c847c 100644 --- a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.ocsp.html b/api/symbols/KJUR.asn1.ocsp.html index f3cec6c0..4a0aed9f 100644 --- a/api/symbols/KJUR.asn1.ocsp.html +++ b/api/symbols/KJUR.asn1.ocsp.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html index 77a18d3a..3e9c02b3 100644 --- a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.Accuracy.html b/api/symbols/KJUR.asn1.tsp.Accuracy.html index 2eefa4ed..35fdaa09 100644 --- a/api/symbols/KJUR.asn1.tsp.Accuracy.html +++ b/api/symbols/KJUR.asn1.tsp.Accuracy.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html index 43e0a8c3..228ecc84 100644 --- a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.MessageImprint.html b/api/symbols/KJUR.asn1.tsp.MessageImprint.html index 8d92b707..2b3f64d3 100644 --- a/api/symbols/KJUR.asn1.tsp.MessageImprint.html +++ b/api/symbols/KJUR.asn1.tsp.MessageImprint.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html index f0ddfd52..c9c29ca7 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html index 94cfc2c0..a01f6034 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatus.html b/api/symbols/KJUR.asn1.tsp.PKIStatus.html index 5c42caf0..51989cd1 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatus.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatus.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html index 997811f5..e417a1ee 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html index c1c1d015..35ab5002 100644 --- a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSPParser.html b/api/symbols/KJUR.asn1.tsp.TSPParser.html index 5c5af127..f0fb701e 100644 --- a/api/symbols/KJUR.asn1.tsp.TSPParser.html +++ b/api/symbols/KJUR.asn1.tsp.TSPParser.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSPUtil.html b/api/symbols/KJUR.asn1.tsp.TSPUtil.html index b153825e..78e91ba7 100644 --- a/api/symbols/KJUR.asn1.tsp.TSPUtil.html +++ b/api/symbols/KJUR.asn1.tsp.TSPUtil.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSTInfo.html b/api/symbols/KJUR.asn1.tsp.TSTInfo.html index 4e7e5b54..7cbef111 100644 --- a/api/symbols/KJUR.asn1.tsp.TSTInfo.html +++ b/api/symbols/KJUR.asn1.tsp.TSTInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html index e23f1016..492d54e6 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html index 27718fc2..4f98f705 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampToken.html b/api/symbols/KJUR.asn1.tsp.TimeStampToken.html index f0d09f64..53c2626f 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampToken.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampToken.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.tsp.html b/api/symbols/KJUR.asn1.tsp.html index d930dc2e..2b5e9a80 100644 --- a/api/symbols/KJUR.asn1.tsp.html +++ b/api/symbols/KJUR.asn1.tsp.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.AdobeTimeStamp.html b/api/symbols/KJUR.asn1.x509.AdobeTimeStamp.html index bd1d9cd4..7b57f7fc 100644 --- a/api/symbols/KJUR.asn1.x509.AdobeTimeStamp.html +++ b/api/symbols/KJUR.asn1.x509.AdobeTimeStamp.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html index 2fa86e55..387667c8 100644 --- a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html index 116d4f1a..7dfe09f8 100644 --- a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html +++ b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html index 59af4761..8e349cab 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html index bb0d375d..8429108e 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.BasicConstraints.html b/api/symbols/KJUR.asn1.x509.BasicConstraints.html index 68cad473..a03ea688 100644 --- a/api/symbols/KJUR.asn1.x509.BasicConstraints.html +++ b/api/symbols/KJUR.asn1.x509.BasicConstraints.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CRL.html b/api/symbols/KJUR.asn1.x509.CRL.html index 8682b33f..e1db2acc 100644 --- a/api/symbols/KJUR.asn1.x509.CRL.html +++ b/api/symbols/KJUR.asn1.x509.CRL.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html index 101c6ffb..24791da6 100644 --- a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html +++ b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLEntry.html b/api/symbols/KJUR.asn1.x509.CRLEntry.html index 7781c8bb..1b1dac8d 100644 --- a/api/symbols/KJUR.asn1.x509.CRLEntry.html +++ b/api/symbols/KJUR.asn1.x509.CRLEntry.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLNumber.html b/api/symbols/KJUR.asn1.x509.CRLNumber.html index dd01bb9d..9b81c380 100644 --- a/api/symbols/KJUR.asn1.x509.CRLNumber.html +++ b/api/symbols/KJUR.asn1.x509.CRLNumber.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLReason.html b/api/symbols/KJUR.asn1.x509.CRLReason.html index 1501ba40..0fbcde52 100644 --- a/api/symbols/KJUR.asn1.x509.CRLReason.html +++ b/api/symbols/KJUR.asn1.x509.CRLReason.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.Certificate.html b/api/symbols/KJUR.asn1.x509.Certificate.html index 51d9aafd..216a60a9 100644 --- a/api/symbols/KJUR.asn1.x509.Certificate.html +++ b/api/symbols/KJUR.asn1.x509.Certificate.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.CertificatePolicies.html b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html index e9cf2649..fe9f3bd1 100644 --- a/api/symbols/KJUR.asn1.x509.CertificatePolicies.html +++ b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.DisplayText.html b/api/symbols/KJUR.asn1.x509.DisplayText.html index 87ce2623..6735bdf6 100644 --- a/api/symbols/KJUR.asn1.x509.DisplayText.html +++ b/api/symbols/KJUR.asn1.x509.DisplayText.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPoint.html b/api/symbols/KJUR.asn1.x509.DistributionPoint.html index 31157d9e..fe121f87 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPoint.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPoint.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPointName.html b/api/symbols/KJUR.asn1.x509.DistributionPointName.html index 33ea845a..c2929c11 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPointName.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPointName.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html index b7ddd8d0..e229283e 100644 --- a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.Extension.html b/api/symbols/KJUR.asn1.x509.Extension.html index 211bcc17..2d837ce0 100644 --- a/api/symbols/KJUR.asn1.x509.Extension.html +++ b/api/symbols/KJUR.asn1.x509.Extension.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.Extensions.html b/api/symbols/KJUR.asn1.x509.Extensions.html index 8bfb2138..bd41ab65 100644 --- a/api/symbols/KJUR.asn1.x509.Extensions.html +++ b/api/symbols/KJUR.asn1.x509.Extensions.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralName.html b/api/symbols/KJUR.asn1.x509.GeneralName.html index 4e189bd5..9a3a5807 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralName.html +++ b/api/symbols/KJUR.asn1.x509.GeneralName.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralNames.html b/api/symbols/KJUR.asn1.x509.GeneralNames.html index eb29a662..ddc0ebcc 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralNames.html +++ b/api/symbols/KJUR.asn1.x509.GeneralNames.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralSubtree.html b/api/symbols/KJUR.asn1.x509.GeneralSubtree.html index a97ee340..99cad791 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralSubtree.html +++ b/api/symbols/KJUR.asn1.x509.GeneralSubtree.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.InhibitAnyPolicy.html b/api/symbols/KJUR.asn1.x509.InhibitAnyPolicy.html index d94cec21..6b383bcb 100644 --- a/api/symbols/KJUR.asn1.x509.InhibitAnyPolicy.html +++ b/api/symbols/KJUR.asn1.x509.InhibitAnyPolicy.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.IssuerAltName.html b/api/symbols/KJUR.asn1.x509.IssuerAltName.html index f89d6f20..65fffe1a 100644 --- a/api/symbols/KJUR.asn1.x509.IssuerAltName.html +++ b/api/symbols/KJUR.asn1.x509.IssuerAltName.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.KeyUsage.html b/api/symbols/KJUR.asn1.x509.KeyUsage.html index 955ac8af..face1ecc 100644 --- a/api/symbols/KJUR.asn1.x509.KeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.KeyUsage.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.NameConstraints.html b/api/symbols/KJUR.asn1.x509.NameConstraints.html index 735ab8b4..ab848b1b 100644 --- a/api/symbols/KJUR.asn1.x509.NameConstraints.html +++ b/api/symbols/KJUR.asn1.x509.NameConstraints.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.NoticeReference.html b/api/symbols/KJUR.asn1.x509.NoticeReference.html index 31dad7a3..7ee206ba 100644 --- a/api/symbols/KJUR.asn1.x509.NoticeReference.html +++ b/api/symbols/KJUR.asn1.x509.NoticeReference.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html b/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html index 0772340f..0802c678 100644 --- a/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html +++ b/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.OCSPNonce.html b/api/symbols/KJUR.asn1.x509.OCSPNonce.html index 05efd8fd..506f62f9 100644 --- a/api/symbols/KJUR.asn1.x509.OCSPNonce.html +++ b/api/symbols/KJUR.asn1.x509.OCSPNonce.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.OID.html b/api/symbols/KJUR.asn1.x509.OID.html index e45bdbde..13f66bcb 100644 --- a/api/symbols/KJUR.asn1.x509.OID.html +++ b/api/symbols/KJUR.asn1.x509.OID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.OtherName.html b/api/symbols/KJUR.asn1.x509.OtherName.html index 2f3b359b..e79605b4 100644 --- a/api/symbols/KJUR.asn1.x509.OtherName.html +++ b/api/symbols/KJUR.asn1.x509.OtherName.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyConstraints.html b/api/symbols/KJUR.asn1.x509.PolicyConstraints.html index ddeaa685..9824b866 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyConstraints.html +++ b/api/symbols/KJUR.asn1.x509.PolicyConstraints.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyInformation.html b/api/symbols/KJUR.asn1.x509.PolicyInformation.html index 9a2c4c9f..3394e90f 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyInformation.html +++ b/api/symbols/KJUR.asn1.x509.PolicyInformation.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyMappings.html b/api/symbols/KJUR.asn1.x509.PolicyMappings.html index 51802a28..1ef6e9ed 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyMappings.html +++ b/api/symbols/KJUR.asn1.x509.PolicyMappings.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html index 4b1f8d49..7f8e9a90 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html +++ b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.PrivateExtension.html b/api/symbols/KJUR.asn1.x509.PrivateExtension.html index bb1cd2db..42aeb00d 100644 --- a/api/symbols/KJUR.asn1.x509.PrivateExtension.html +++ b/api/symbols/KJUR.asn1.x509.PrivateExtension.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.RDN.html b/api/symbols/KJUR.asn1.x509.RDN.html index 86763171..5c1edb1e 100644 --- a/api/symbols/KJUR.asn1.x509.RDN.html +++ b/api/symbols/KJUR.asn1.x509.RDN.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectAltName.html b/api/symbols/KJUR.asn1.x509.SubjectAltName.html index c8992eb1..78e71eb0 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectAltName.html +++ b/api/symbols/KJUR.asn1.x509.SubjectAltName.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectDirectoryAttributes.html b/api/symbols/KJUR.asn1.x509.SubjectDirectoryAttributes.html index 0d2e865e..5736bb65 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectDirectoryAttributes.html +++ b/api/symbols/KJUR.asn1.x509.SubjectDirectoryAttributes.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html index 5ade025f..b5ac3c67 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html index 80077849..613aaf37 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html +++ b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertList.html b/api/symbols/KJUR.asn1.x509.TBSCertList.html index 9a3faf0b..6b8e4bd7 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertList.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertList.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertificate.html b/api/symbols/KJUR.asn1.x509.TBSCertificate.html index 94e673c5..a86f487e 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertificate.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertificate.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.Time.html b/api/symbols/KJUR.asn1.x509.Time.html index ce31ce96..5a836862 100644 --- a/api/symbols/KJUR.asn1.x509.Time.html +++ b/api/symbols/KJUR.asn1.x509.Time.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.UserNotice.html b/api/symbols/KJUR.asn1.x509.UserNotice.html index 8e64de58..beb7d933 100644 --- a/api/symbols/KJUR.asn1.x509.UserNotice.html +++ b/api/symbols/KJUR.asn1.x509.UserNotice.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.X500Name.html b/api/symbols/KJUR.asn1.x509.X500Name.html index ee6d69c2..0a535c6d 100644 --- a/api/symbols/KJUR.asn1.x509.X500Name.html +++ b/api/symbols/KJUR.asn1.x509.X500Name.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.X509Util.html b/api/symbols/KJUR.asn1.x509.X509Util.html index 3ecb3e1a..6f2a688c 100644 --- a/api/symbols/KJUR.asn1.x509.X509Util.html +++ b/api/symbols/KJUR.asn1.x509.X509Util.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.asn1.x509.html b/api/symbols/KJUR.asn1.x509.html index 63a1d1a3..7f34333b 100644 --- a/api/symbols/KJUR.asn1.x509.html +++ b/api/symbols/KJUR.asn1.x509.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.Cipher.html b/api/symbols/KJUR.crypto.Cipher.html new file mode 100644 index 00000000..d6d55f4c --- /dev/null +++ b/api/symbols/KJUR.crypto.Cipher.html @@ -0,0 +1,865 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.crypto.Cipher + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.crypto.Cipher +

    + + +

    + + + + Cipher class to encrypt and decrypt data
    + + +
    Defined in: crypto-1.1.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      +
    + KJUR.crypto.Cipher(params) +
    +
    Cipher class to encrypt and decrypt data
    +Here is supported canonicalized cipher algorithm names and its standard names: +
      +
    • aes256-CBC
    • +
    • aes128-CBC
    • +
    • des-EDE3-CBC
    • +
    +NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +because of Marvin attack vulnerability.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <static>   +
    KJUR.crypto.Cipher.decrypt(hex, hexadecimal, algName, param) +
    +
    decrypt encrypted hexadecimal string with specified key and algorithm
    +This static method decrypts encrypted hexadecimal string with specified key and algorithm.
    +
    <static>   +
    KJUR.crypto.Cipher.encrypt(s, hexadecimal, algName, param) +
    +
    encrypt raw string by specified key and algorithm
    +This static method encrypts raw string with specified key and algorithm.
    +
    + + + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.crypto.Cipher(params) +
    + +
    + Cipher class to encrypt and decrypt data
    +Here is supported canonicalized cipher algorithm names and its standard names: +
      +
    • aes256-CBC
    • +
    • aes128-CBC
    • +
    • des-EDE3-CBC
    • +
    +NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +because of Marvin attack vulnerability. + +
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    parameters for constructor
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.2.0 crypto 1.1.10
    +
    + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    <static> + + {string} + KJUR.crypto.Cipher.decrypt(hex, hexadecimal, algName, param) + +
    +
    + decrypt encrypted hexadecimal string with specified key and algorithm
    +This static method decrypts encrypted hexadecimal string with specified key and algorithm. +
    +NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBCis also supported. +NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +because of Marvin attack vulnerability. + + +
    + + + +
    +KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
    +KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
    +KJUR.crypto.Cipher.decrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
    +KJUR.crypto.Cipher.decrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." })
    + + + + +
    +
    Parameters:
    + +
    + {string} hex + +
    +
    hexadecimal string of encrypted message
    + +
    + {object} hexadecimal + +
    +
    string of symmetric cipher key
    + +
    + {string} algName + +
    +
    short/long algorithm name for encryption/decryption (OPTION)
    + +
    + {object} param + +
    +
    parameters for synchronous cipher such as initial vector (OPTION)
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.2.0 crypto 1.1.10
    +
    + + + + +
    +
    Returns:
    + +
    {string} decrypted raw string
    + +
    + + + + +
    + + +
    <static> + + {string} + KJUR.crypto.Cipher.encrypt(s, hexadecimal, algName, param) + +
    +
    + encrypt raw string by specified key and algorithm
    +This static method encrypts raw string with specified key and algorithm. +
    +NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBC) is also supported. +NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +because of Marvin attack vulnerability. + + +
    + + + +
    +KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
    +KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
    +KJUR.crypto.Cipher.encrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
    +KJUR.crypto.Cipher.encrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." })
    + + + + +
    +
    Parameters:
    + +
    + {string} s + +
    +
    input string to encrypt
    + +
    + {string} hexadecimal + +
    +
    string of symmetric cipher key
    + +
    + {string} algName + +
    +
    short/long algorithm name for encryption/decryption (OPTION)
    + +
    + {object} param + +
    +
    parameters for synchronous cipher such as initial vector (OPTION)
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.2.0 crypto 1.1.10
    +
    + + + + +
    +
    Returns:
    + +
    {string} hexadecimal encrypted string
    + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2023 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.crypto.DSA.html b/api/symbols/KJUR.crypto.DSA.html index 80f5c7ae..7763f0f4 100644 --- a/api/symbols/KJUR.crypto.DSA.html +++ b/api/symbols/KJUR.crypto.DSA.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.ECDSA.html b/api/symbols/KJUR.crypto.ECDSA.html index 02df9c8c..fc861071 100644 --- a/api/symbols/KJUR.crypto.ECDSA.html +++ b/api/symbols/KJUR.crypto.ECDSA.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.ECParameterDB.html b/api/symbols/KJUR.crypto.ECParameterDB.html index 395a630f..a055c199 100644 --- a/api/symbols/KJUR.crypto.ECParameterDB.html +++ b/api/symbols/KJUR.crypto.ECParameterDB.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.Mac.html b/api/symbols/KJUR.crypto.Mac.html index 96a0d0b2..d723eb36 100644 --- a/api/symbols/KJUR.crypto.Mac.html +++ b/api/symbols/KJUR.crypto.Mac.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.MessageDigest.html b/api/symbols/KJUR.crypto.MessageDigest.html index 21d156b3..8dd35c87 100644 --- a/api/symbols/KJUR.crypto.MessageDigest.html +++ b/api/symbols/KJUR.crypto.MessageDigest.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.OID.html b/api/symbols/KJUR.crypto.OID.html index e2ab0dcd..b9561679 100644 --- a/api/symbols/KJUR.crypto.OID.html +++ b/api/symbols/KJUR.crypto.OID.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.Signature.html b/api/symbols/KJUR.crypto.Signature.html index c10115f9..c05d3ac6 100644 --- a/api/symbols/KJUR.crypto.Signature.html +++ b/api/symbols/KJUR.crypto.Signature.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.Util.html b/api/symbols/KJUR.crypto.Util.html index 7ba6f275..e7fc9e24 100644 --- a/api/symbols/KJUR.crypto.Util.html +++ b/api/symbols/KJUR.crypto.Util.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.crypto.html b/api/symbols/KJUR.crypto.html index 8fb16f96..88bf7653 100644 --- a/api/symbols/KJUR.crypto.html +++ b/api/symbols/KJUR.crypto.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.html b/api/symbols/KJUR.html index c0f02d0d..069d6d5a 100644 --- a/api/symbols/KJUR.html +++ b/api/symbols/KJUR.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.jws.IntDate.html b/api/symbols/KJUR.jws.IntDate.html index dce0a9e3..ec17a636 100644 --- a/api/symbols/KJUR.jws.IntDate.html +++ b/api/symbols/KJUR.jws.IntDate.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.jws.JWS.html b/api/symbols/KJUR.jws.JWS.html index d8bb5e55..18fa857d 100644 --- a/api/symbols/KJUR.jws.JWS.html +++ b/api/symbols/KJUR.jws.JWS.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.jws.JWSJS.html b/api/symbols/KJUR.jws.JWSJS.html index 68d73e61..39bf097e 100644 --- a/api/symbols/KJUR.jws.JWSJS.html +++ b/api/symbols/KJUR.jws.JWSJS.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.jws.html b/api/symbols/KJUR.jws.html index 28cd777f..f979b718 100644 --- a/api/symbols/KJUR.jws.html +++ b/api/symbols/KJUR.jws.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/KJUR.lang.String.html b/api/symbols/KJUR.lang.String.html index 29f61f4c..264535e3 100644 --- a/api/symbols/KJUR.lang.String.html +++ b/api/symbols/KJUR.lang.String.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/RSAKey.html b/api/symbols/RSAKey.html index 0f35f7db..5b7ae0c0 100644 --- a/api/symbols/RSAKey.html +++ b/api/symbols/RSAKey.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/X509.html b/api/symbols/X509.html index 57271682..d5a08ebb 100644 --- a/api/symbols/X509.html +++ b/api/symbols/X509.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/X509CRL.html b/api/symbols/X509CRL.html index 3221f4bd..02d7d00c 100644 --- a/api/symbols/X509CRL.html +++ b/api/symbols/X509CRL.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/global__.html b/api/symbols/global__.html index 4e5311fd..0f6cda65 100644 --- a/api/symbols/global__.html +++ b/api/symbols/global__.html @@ -487,6 +487,8 @@

    Classes

  • KJUR.crypto
  • +
  • KJUR.crypto.Cipher
  • +
  • KJUR.crypto.DSA
  • KJUR.crypto.ECDSA
  • diff --git a/api/symbols/src/crypto-1.1.js.html b/api/symbols/src/crypto-1.1.js.html index d7316284..48dc827e 100644 --- a/api/symbols/src/crypto-1.1.js.html +++ b/api/symbols/src/crypto-1.1.js.html @@ -5,12 +5,12 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 /* crypto-2.0.0.js (c) 2013-2024 Kenji Urushima | kjur.github.io/jsrsasign/license
    +	
      1 /* crypto-2.1.0.js (c) 2013-2024 Kenji Urushima | kjur.github.io/jsrsasign/license
       2  */
       3 /*
       4  * crypto.js - Cryptographic Algorithm Provider class
       5  *
    -  6  * Copyright (c) 2013-2021 Kenji Urushima (kenji.urushima@gmail.com)
    +  6  * Copyright (c) 2013-2024 Kenji Urushima (kenji.urushima@gmail.com)
       7  *
       8  * This software is licensed under the terms of the MIT License.
       9  * https://kjur.github.io/jsrsasign/license
    @@ -23,7 +23,7 @@
      16  * @fileOverview
      17  * @name crypto-1.1.js
      18  * @author Kenji Urushima kenji.urushima@gmail.com
    - 19  * @version jsrsasign 11.0.0 crypto 2.0.0 (2024-Jan-16)
    + 19  * @version jsrsasign 11.1.0 crypto 2.1.0 (2024-Feb-01)
      20  * @since jsrsasign 2.2
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -1380,7 +1380,7 @@
     1373 };
     1374 
     1375 // ====== Cipher class ============================================================
    -1376 /*
    +1376 /**
     1377  * Cipher class to encrypt and decrypt data<br/>
     1378  * @name KJUR.crypto.Cipher
     1379  * @class Cipher class to encrypt and decrypt data<br/>
    @@ -1389,208 +1389,177 @@
     1382  * @description
     1383  * Here is supported canonicalized cipher algorithm names and its standard names:
     1384  * <ul>
    -1385  * <li>RSA - RSA/ECB/PKCS1Padding (default for RSAKey)</li>
    -1386  * <li>RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding</li>
    -1387  * <li>RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)</li>
    -1388  * <li>RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding</li>
    -1389  * <li>RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)</li>
    -1390  * <li>RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)</li>
    -1391  * </ul>
    -1392  * NOTE: (*) is not supported in Java JCE.<br/>
    -1393  * Currently this class supports only RSA encryption and decryption 
    -1394  * based on RSAES-OAEP and RSAES-PKCS1-v1_5 scheme. 
    -1395  * However it is planning to implement also symmetric ciphers near in the future */
    -1396 /*
    -1397 KJUR.crypto.Cipher = function(params) {
    -1398 };
    -1399  */
    -1400 /*
    -1401  * encrypt raw string by specified key and algorithm<br/>
    -1402  * @name encrypt
    -1403  * @memberOf KJUR.crypto.Cipher
    -1404  * @function
    -1405  * @param {String} s input string to encrypt
    -1406  * @param {Object} keyObj RSAKey object or hexadecimal string of symmetric cipher key
    -1407  * @param {String} algName short/long algorithm name for encryption/decryption (OPTION)
    -1408  * @param {object} param parameters for synchronous cipher such as initial vector (OPTION)
    -1409  * @return {String} hexadecimal encrypted string
    -1410  * @since jsrsasign 6.2.0 crypto 1.1.10
    -1411  *
    -1412  * @description
    -1413  * This static method encrypts raw string with specified key and algorithm.
    -1414  * <br/>
    -1415  * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBC) is also supported.
    -1416  *
    -1417  * @example 
    -1418  * // asynchronous cipher
    -1419  * KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj) → "1abc2d..."
    -1420  * KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj, "RSAOAEP") → "23ab02..."
    -1421  * // synchronous cipher
    -1422  * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
    -1423  * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
    -1424  * KJUR.crypto.Cipher.encrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
    -1425  * KJUR.crypto.Cipher.encrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) 
    -1426  */
    -1427 /*
    -1428 KJUR.crypto.Cipher.encrypt = function(s, keyObj, algName, param) {
    -1429     if (aryval(param, "enclag") != undefined) algName = param.encalg;
    -1430 
    -1431     if (typeof algName == "string" && algName.substr(-4) == "-CBC") {
    -1432 	var hKey = keyObj;
    -1433 	var hPlain = s;
    -1434 	if (aryval(param, "key") != undefined) hKey = param.key;
    -1435 	if (aryval(param, "enc") != undefined) hEnc = param.enc;
    -1436 	var wKey = CryptoJS.enc.Hex.parse(hKey);
    -1437 	var wPlain = CryptoJS.enc.Hex.parse(hPlain);
    -1438 	var wIV = CryptoJS.enc.Hex.parse(param.iv);
    -1439 	var wEnc;
    -1440 	if (algName == "des-EDE3-CBC") {
    -1441 	    wEnc = CryptoJS.TripleDES.encrypt(wPlain, wKey, { iv: wIV });
    -1442 	} else if (algName == "aes128-CBC" || algName == "aes256-CBC") {
    -1443 	    wEnc = CryptoJS.AES.encrypt(wPlain, wKey, { iv: wIV });
    -1444 	} else {
    -1445 	    throw new Error("unsupported algorithm: " + algName);
    -1446 	}
    -1447 	return wEnc + "";
    -1448     } else if (keyObj instanceof RSAKey && keyObj.isPublic) {
    -1449 	var algName2 = KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName);
    -1450 	if (algName2 === "RSA") return keyObj.encrypt(s);
    -1451 	if (algName2 === "RSAOAEP") return keyObj.encryptOAEP(s, "sha1");
    -1452 
    -1453 	var a = algName2.match(/^RSAOAEP(\d+)$/);
    -1454 	if (a !== null) return keyObj.encryptOAEP(s, "sha" + a[1]);
    -1455 
    -1456 	throw "Cipher.encrypt: unsupported algorithm for RSAKey: " + algName;
    -1457     } else {
    -1458 	throw "Cipher.encrypt: unsupported key or algorithm";
    -1459     }
    -1460 };
    -1461  */
    -1462 
    -1463 /*
    -1464  * decrypt encrypted hexadecimal string with specified key and algorithm<br/>
    -1465  * @name decrypt
    -1466  * @memberOf KJUR.crypto.Cipher
    -1467  * @function
    -1468  * @param {string} hex hexadecimal string of encrypted message
    -1469  * @param {object} keyObj RSAKey object or hexadecimal string of symmetric cipher key
    -1470  * @param {string} algName short/long algorithm name for encryption/decryption (OPTION)
    -1471  * @param {object} param parameters for synchronous cipher such as initial vector (OPTION)
    -1472  * @return {String} decrypted raw string
    -1473  * @since jsrsasign 6.2.0 crypto 1.1.10
    -1474  *
    -1475  * @description
    -1476  * This static method decrypts encrypted hexadecimal string with specified key and algorithm.
    -1477  * <br/>
    -1478  * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBCis also supported.
    -1479  *
    -1480  * @example 
    -1481  * // asynchronous cipher
    -1482  * KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj) → "1abc2d..."
    -1483  * KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj, "RSAOAEP) → "23ab02..."
    -1484  * // synchronous cipher
    -1485  * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) 
    -1486  * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) 
    -1487  * KJUR.crypto.Cipher.decrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) 
    -1488  * KJUR.crypto.Cipher.decrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) 
    -1489  */
    -1490 /*
    -1491 KJUR.crypto.Cipher.decrypt = function(hex, keyObj, algName, param) {
    -1492     if (aryval(param, "enclag") != undefined) algName = param.encalg;
    -1493 
    -1494     if (typeof algName == "string" && algName.substr(-4) == "-CBC") {
    -1495 	var hKey = keyObj;
    -1496 	var hEnc = hex;
    -1497 	if (aryval(param, "key") != undefined) hKey = param.key;
    -1498 	if (aryval(param, "enc") != undefined) hEnc = param.enc;
    -1499 	var wKey = CryptoJS.enc.Hex.parse(hKey);
    -1500 	var wEnc = CryptoJS.enc.Hex.parse(hEnc);
    -1501 	var wIV = CryptoJS.enc.Hex.parse(param.iv);
    -1502 	var wDec;
    -1503 	if (algName == "des-EDE3-CBC") {
    -1504 	    wDec = CryptoJS.TripleDES.decrypt({ ciphertext: wEnc }, wKey, { iv: wIV });
    -1505 	} else if (algName == "aes128-CBC" || algName == "aes256-CBC") {
    -1506 	    wDec = CryptoJS.AES.decrypt({ ciphertext: wEnc }, wKey, { iv: wIV });
    -1507 	} else {
    -1508 	    throw new Error("unsupported algorithm: " + algName);
    -1509 	}
    -1510 	return CryptoJS.enc.Hex.stringify(wDec);
    -1511     } else if (keyObj instanceof RSAKey && keyObj.isPrivate) {
    -1512 	var algName2 = KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName);
    -1513 	if (algName2 === "RSA") return keyObj.decrypt(hex);
    -1514 	if (algName2 === "RSAOAEP") return keyObj.decryptOAEP(hex, "sha1");
    -1515 
    -1516 	var a = algName2.match(/^RSAOAEP(\d+)$/);
    -1517 	if (a !== null) return keyObj.decryptOAEP(hex, "sha" + a[1]);
    -1518 
    -1519 	throw "Cipher.decrypt: unsupported algorithm for RSAKey: " + algName;
    -1520     } else {
    -1521 	throw "Cipher.decrypt: unsupported key or algorithm";
    -1522     }
    -1523 };
    -1524  */
    -1525 
    -1526 /*
    -1527  * get canonicalized encrypt/decrypt algorithm name by key and short/long algorithm name<br/>
    -1528  * @name getAlgByKeyAndName
    -1529  * @memberOf KJUR.crypto.Cipher
    -1530  * @function
    -1531  * @param {Object} keyObj RSAKey object or hexadecimal string of symmetric cipher key
    -1532  * @param {String} algName short/long algorithm name for encryption/decryption
    -1533  * @return {String} canonicalized algorithm name for encryption/decryption
    -1534  * @since jsrsasign 6.2.0 crypto 1.1.10
    -1535  * @description
    -1536  * Here is supported canonicalized cipher algorithm names and its standard names:
    -1537  * <ul>
    -1538  * <li>RSA - RSA/ECB/PKCS1Padding (default for RSAKey)</li>
    -1539  * <li>RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding</li>
    -1540  * <li>RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)</li>
    -1541  * <li>RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding</li>
    -1542  * <li>RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)</li>
    -1543  * <li>RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)</li>
    -1544  * </ul>
    -1545  * NOTE: (*) is not supported in Java JCE.
    -1546  * @example 
    -1547  * KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey) → "RSA"
    -1548  * KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey, "RSAOAEP") → "RSAOAEP"
    -1549  */
    -1550 /*
    -1551 KJUR.crypto.Cipher.getAlgByKeyAndName = function(keyObj, algName) {
    -1552     if (keyObj instanceof RSAKey) {
    -1553 	if (":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(algName) != -1)
    -1554 	    return algName;
    -1555 	if (algName === null || algName === undefined) return "RSA";
    -1556 	throw "getAlgByKeyAndName: not supported algorithm name for RSAKey: " + algName;
    -1557     }
    -1558     throw "getAlgByKeyAndName: not supported algorithm name: " + algName;
    -1559 }
    -1560  */
    -1561 
    -1562 // ====== Other Utility class =====================================================
    -1563 
    -1564 /**
    -1565  * static object for cryptographic function utilities
    -1566  * @name KJUR.crypto.OID
    -1567  * @class static object for cryptography related OIDs
    -1568  * @property {Array} oidhex2name key value of hexadecimal OID and its name
    -1569  *           (ex. '2a8648ce3d030107' and 'secp256r1')
    -1570  * @since crypto 1.1.3
    -1571  * @description
    -1572  */
    -1573 KJUR.crypto.OID = new function() {
    -1574     this.oidhex2name = {
    -1575 	'2a864886f70d010101': 'rsaEncryption',
    -1576 	'2a8648ce3d0201': 'ecPublicKey',
    -1577 	'2a8648ce380401': 'dsa',
    -1578 	'2a8648ce3d030107': 'secp256r1',
    -1579 	'2b8104001f': 'secp192k1',
    -1580 	'2b81040021': 'secp224r1',
    -1581 	'2b8104000a': 'secp256k1',
    -1582 	'2b81040022': 'secp384r1',
    -1583 	'2b81040023': 'secp521r1',
    -1584 	'2a8648ce380403': 'SHA1withDSA', // 1.2.840.10040.4.3
    -1585 	'608648016503040301': 'SHA224withDSA', // 2.16.840.1.101.3.4.3.1
    -1586 	'608648016503040302': 'SHA256withDSA', // 2.16.840.1.101.3.4.3.2
    -1587     };
    -1588 };
    -1589 
    \ No newline at end of file +1385 * <li>aes256-CBC</li> +1386 * <li>aes128-CBC</li> +1387 * <li>des-EDE3-CBC</li> +1388 * </ul> +1389 * NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +1390 * because of Marvin attack vulnerability. +1391 */
    +1392 KJUR.crypto.Cipher = function(params) { +1393 }; +1394 +1395 /** +1396 * encrypt raw string by specified key and algorithm<br/> +1397 * @name encrypt +1398 * @memberOf KJUR.crypto.Cipher +1399 * @function +1400 * @param {string} s input string to encrypt +1401 * @param {string} hexadecimal string of symmetric cipher key +1402 * @param {string} algName short/long algorithm name for encryption/decryption (OPTION) +1403 * @param {object} param parameters for synchronous cipher such as initial vector (OPTION) +1404 * @return {string} hexadecimal encrypted string +1405 * @since jsrsasign 6.2.0 crypto 1.1.10 +1406 * +1407 * @description +1408 * This static method encrypts raw string with specified key and algorithm. +1409 * <br/> +1410 * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBC) is also supported. +1411 * NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +1412 * because of Marvin attack vulnerability. +1413 * +1414 * @example +1415 * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) +1416 * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) +1417 * KJUR.crypto.Cipher.encrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) +1418 * KJUR.crypto.Cipher.encrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) +1419 */ +1420 KJUR.crypto.Cipher.encrypt = function(s, keyObj, algName, param) { +1421 if (aryval(param, "enclag") != undefined) algName = param.encalg; +1422 +1423 if (typeof algName == "string" && algName.substr(-4) == "-CBC") { +1424 var hKey = keyObj; +1425 var hPlain = s; +1426 if (aryval(param, "key") != undefined) hKey = param.key; +1427 if (aryval(param, "enc") != undefined) hEnc = param.enc; +1428 var wKey = CryptoJS.enc.Hex.parse(hKey); +1429 var wPlain = CryptoJS.enc.Hex.parse(hPlain); +1430 var wIV = CryptoJS.enc.Hex.parse(param.iv); +1431 var wEnc; +1432 if (algName == "des-EDE3-CBC") { +1433 wEnc = CryptoJS.TripleDES.encrypt(wPlain, wKey, { iv: wIV }); +1434 } else if (algName == "aes128-CBC" || algName == "aes256-CBC") { +1435 wEnc = CryptoJS.AES.encrypt(wPlain, wKey, { iv: wIV }); +1436 } else { +1437 throw new Error("unsupported algorithm: " + algName); +1438 } +1439 return wEnc + ""; +1440 } else { +1441 throw new Error("Cipher.encrypt: unsupported key or algorithm"); +1442 } +1443 }; +1444 +1445 /** +1446 * decrypt encrypted hexadecimal string with specified key and algorithm<br/> +1447 * @name decrypt +1448 * @memberOf KJUR.crypto.Cipher +1449 * @function +1450 * @param {string} hex hexadecimal string of encrypted message +1451 * @param {object} hexadecimal string of symmetric cipher key +1452 * @param {string} algName short/long algorithm name for encryption/decryption (OPTION) +1453 * @param {object} param parameters for synchronous cipher such as initial vector (OPTION) +1454 * @return {string} decrypted raw string +1455 * @since jsrsasign 6.2.0 crypto 1.1.10 +1456 * +1457 * @description +1458 * This static method decrypts encrypted hexadecimal string with specified key and algorithm. +1459 * <br/> +1460 * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBCis also supported. +1461 * NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed +1462 * because of Marvin attack vulnerability. +1463 * +1464 * @example +1465 * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) +1466 * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) +1467 * KJUR.crypto.Cipher.decrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) +1468 * KJUR.crypto.Cipher.decrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) +1469 */ +1470 KJUR.crypto.Cipher.decrypt = function(hex, keyObj, algName, param) { +1471 if (aryval(param, "enclag") != undefined) algName = param.encalg; +1472 +1473 if (typeof algName == "string" && algName.substr(-4) == "-CBC") { +1474 var hKey = keyObj; +1475 var hEnc = hex; +1476 if (aryval(param, "key") != undefined) hKey = param.key; +1477 if (aryval(param, "enc") != undefined) hEnc = param.enc; +1478 var wKey = CryptoJS.enc.Hex.parse(hKey); +1479 var wEnc = CryptoJS.enc.Hex.parse(hEnc); +1480 var wIV = CryptoJS.enc.Hex.parse(param.iv); +1481 var wDec; +1482 if (algName == "des-EDE3-CBC") { +1483 wDec = CryptoJS.TripleDES.decrypt({ ciphertext: wEnc }, wKey, { iv: wIV }); +1484 } else if (algName == "aes128-CBC" || algName == "aes256-CBC") { +1485 wDec = CryptoJS.AES.decrypt({ ciphertext: wEnc }, wKey, { iv: wIV }); +1486 } else { +1487 throw new Error("unsupported algorithm: " + algName); +1488 } +1489 return CryptoJS.enc.Hex.stringify(wDec); +1490 } else { +1491 throw new Error("Cipher.decrypt: unsupported key or algorithm"); +1492 } +1493 }; +1494 +1495 /* +1496 * get canonicalized encrypt/decrypt algorithm name by key and short/long algorithm name<br/> +1497 * @name getAlgByKeyAndName +1498 * @memberOf KJUR.crypto.Cipher +1499 * @function +1500 * @param {Object} keyObj RSAKey object or hexadecimal string of symmetric cipher key +1501 * @param {String} algName short/long algorithm name for encryption/decryption +1502 * @return {String} canonicalized algorithm name for encryption/decryption +1503 * @since jsrsasign 6.2.0 crypto 1.1.10 +1504 * @description +1505 * Here is supported canonicalized cipher algorithm names and its standard names: +1506 * <ul> +1507 * <li>RSA - RSA/ECB/PKCS1Padding (default for RSAKey)</li> +1508 * <li>RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding</li> +1509 * <li>RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)</li> +1510 * <li>RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding</li> +1511 * <li>RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)</li> +1512 * <li>RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)</li> +1513 * </ul> +1514 * NOTE: (*) is not supported in Java JCE. +1515 * @example +1516 * KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey) → "RSA" +1517 * KJUR.crypto.Cipher.getAlgByKeyAndName(objRSAKey, "RSAOAEP") → "RSAOAEP" +1518 */ +1519 /* +1520 KJUR.crypto.Cipher.getAlgByKeyAndName = function(keyObj, algName) { +1521 if (keyObj instanceof RSAKey) { +1522 if (":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(algName) != -1) +1523 return algName; +1524 if (algName === null || algName === undefined) return "RSA"; +1525 throw "getAlgByKeyAndName: not supported algorithm name for RSAKey: " + algName; +1526 } +1527 throw "getAlgByKeyAndName: not supported algorithm name: " + algName; +1528 } +1529 */ +1530 +1531 // ====== Other Utility class ===================================================== +1532 +1533 /** +1534 * static object for cryptographic function utilities +1535 * @name KJUR.crypto.OID +1536 * @class static object for cryptography related OIDs +1537 * @property {Array} oidhex2name key value of hexadecimal OID and its name +1538 * (ex. '2a8648ce3d030107' and 'secp256r1') +1539 * @since crypto 1.1.3 +1540 * @description +1541 */ +1542 KJUR.crypto.OID = new function() { +1543 this.oidhex2name = { +1544 '2a864886f70d010101': 'rsaEncryption', +1545 '2a8648ce3d0201': 'ecPublicKey', +1546 '2a8648ce380401': 'dsa', +1547 '2a8648ce3d030107': 'secp256r1', +1548 '2b8104001f': 'secp192k1', +1549 '2b81040021': 'secp224r1', +1550 '2b8104000a': 'secp256k1', +1551 '2b81040022': 'secp384r1', +1552 '2b81040023': 'secp521r1', +1553 '2a8648ce380403': 'SHA1withDSA', // 1.2.840.10040.4.3 +1554 '608648016503040301': 'SHA224withDSA', // 2.16.840.1.101.3.4.3.1 +1555 '608648016503040302': 'SHA256withDSA', // 2.16.840.1.101.3.4.3.2 +1556 }; +1557 }; +1558
    \ No newline at end of file diff --git a/jsrsasign-all-min.js b/jsrsasign-all-min.js index c7f3eb47..8abda805 100644 --- a/jsrsasign-all-min.js +++ b/jsrsasign-all-min.js @@ -1,8 +1,8 @@ /* - * jsrsasign(all) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license + * jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license */ -var VERSION = "11.0.0"; -var VERSION_FULL = "jsrsasign(all) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; +var VERSION = "11.1.0"; +var VERSION_FULL = "jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; /*! CryptoJS v3.1.2 core-fix.js * code.google.com/p/crypto-js @@ -228,7 +228,7 @@ if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!K if(typeof KJUR.asn1.csr=="undefined"||!KJUR.asn1.csr){KJUR.asn1.csr={}}KJUR.asn1.csr.CertificationRequest=function(g){var d=KJUR,c=d.asn1,e=c.DERBitString,b=c.DERSequence,a=c.csr,f=c.x509,h=a.CertificationRequestInfo;a.CertificationRequest.superclass.constructor.call(this);this.setByParam=function(i){this.params=i};this.sign=function(){var j=(new h(this.params)).tohex();var k=new KJUR.crypto.Signature({alg:this.params.sigalg});k.init(this.params.sbjprvkey);k.updateHex(j);var i=k.sign();this.params.sighex=i};this.getPEM=function(){return hextopem(this.tohex(),"CERTIFICATE REQUEST")};this.tohex=function(){var l=this.params;var j=new KJUR.asn1.csr.CertificationRequestInfo(this.params);var m=new KJUR.asn1.x509.AlgorithmIdentifier({name:l.sigalg});if(l.sighex==undefined&&l.sbjprvkey!=undefined){this.sign()}if(l.sighex==undefined){throw new Error("sighex or sbjprvkey parameter not defined")}var k=new e({hex:"00"+l.sighex});var i=new b({array:[j,m,k]});return i.tohex()};this.getEncodedHex=function(){return this.tohex()};if(g!==undefined){this.setByParam(g)}};extendClass(KJUR.asn1.csr.CertificationRequest,KJUR.asn1.ASN1Object);KJUR.asn1.csr.CertificationRequestInfo=function(f){var b=KJUR,j=b.asn1,c=j.DERBitString,g=j.DERSequence,i=j.DERInteger,p=j.DERUTF8String,d=j.DERTaggedObject,h=j.ASN1Util.newObject,n=j.csr,e=j.x509,a=e.X500Name,l=e.Extensions,o=e.SubjectPublicKeyInfo,k=n.AttributeList;n.CertificationRequestInfo.superclass.constructor.call(this);this.params=null;this.setByParam=function(q){if(q!=undefined){this.params=q}};this.tohex=function(){var v=this.params;var r=[];r.push(new i({"int":0}));r.push(new a(v.subject));r.push(new o(KEYUTIL.getKey(v.sbjpubkey)));if(v.attrs!=undefined){var u=m(v.attrs);var t=h({tag:{tage:"a0",obj:u}});r.push(t)}else{if(v.extreq!=undefined){var q=new l(v.extreq);var t=h({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[q]}]}}});r.push(t)}else{r.push(new d({tag:"a0",explicit:false,obj:new p({str:""})}))}}var s=new g({array:r});return s.tohex()};this.getEncodedHex=function(){return this.tohex()};function m(s){var w=Error,v=KJUR.asn1.x509.Extensions;var y=[];for(var u=0;u>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f=0;--u){v=v.twice2D();v.z=f.ONE;if(t.testBit(u)){if(s.testBit(u)){v=v.add2D(y)}else{v=v.add2D(x)}}else{if(s.testBit(u)){v=v.add2D(w)}}}return v}this.getBigRandom=function(r){return new f(r.bitLength(),a).mod(r.subtract(f.ONE)).add(f.ONE)};this.setNamedCurve=function(r){this.ecparams=c.getByName(r);this.prvKeyHex=null;this.pubKeyHex=null;this.curveName=r};this.setPrivateKeyHex=function(r){this.isPrivate=true;this.prvKeyHex=r};this.setPublicKeyHex=function(r){this.isPublic=true;this.pubKeyHex=r};this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if(t.substr(0,2)!=="04"){throw"this method supports uncompressed format(04) only"}var s=this.ecparams.keycharlen;if(t.length!==2+s*2){throw"malformed public key hex length"}var r={};r.x=t.substr(2,s);r.y=t.substr(2+s);return r};this.getShortNISTPCurveName=function(){var r=this.curveName;if(r==="secp256r1"||r==="NIST P-256"||r==="P-256"||r==="prime256v1"){return"P-256"}if(r==="secp384r1"||r==="NIST P-384"||r==="P-384"){return"P-384"}if(r==="secp521r1"||r==="NIST P-521"||r==="P-521"){return"P-521"}return null};this.generateKeyPairHex=function(){var s=this.ecparams.n;var u=this.getBigRandom(s);var r=this.ecparams.keycharlen;var t=("0000000000"+u.toString(16)).slice(-r);this.setPrivateKeyHex(t);var v=this.generatePublicKeyHex();return{ecprvhex:t,ecpubhex:v}};this.generatePublicKeyHex=function(){var u=new f(this.prvKeyHex,16);var w=this.ecparams.G.multiply(u);var t=w.getX().toBigInteger();var s=w.getY().toBigInteger();var r=this.ecparams.keycharlen;var y=("0000000000"+t.toString(16)).slice(-r);var v=("0000000000"+s.toString(16)).slice(-r);var x="04"+y+v;this.setPublicKeyHex(x);return x};this.signWithMessageHash=function(r){return this.signHex(r,this.prvKeyHex)};this.signHex=function(x,u){var A=new f(u,16);var v=this.ecparams.n;var z=new f(x.substring(0,this.ecparams.keycharlen),16);do{var w=this.getBigRandom(v);var B=this.ecparams.G;var y=B.multiply(w);var t=y.getX().toBigInteger().mod(v)}while(t.compareTo(f.ZERO)<=0);var C=w.modInverse(v).multiply(z.add(A.multiply(t))).mod(v);return m.biRSSigToASN1Sig(t,C)};this.sign=function(w,B){var z=B;var u=this.ecparams.n;var y=f.fromByteArrayUnsigned(w);do{var v=this.getBigRandom(u);var A=this.ecparams.G;var x=A.multiply(v);var t=x.getX().toBigInteger().mod(u)}while(t.compareTo(BigInteger.ZERO)<=0);var C=v.modInverse(u).multiply(y.add(z.multiply(t))).mod(u);return this.serializeSig(t,C)};this.verifyWithMessageHash=function(s,r){return this.verifyHex(s,r,this.pubKeyHex)};this.verifyHex=function(v,y,u){try{var t,B;var w=m.parseSigHex(y);t=w.r;B=w.s;var x=h.decodeFromHex(this.ecparams.curve,u);var z=new f(v.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(z,t,B,x)}catch(A){return false}};this.verify=function(z,A,u){var w,t;if(Bitcoin.Util.isArray(A)){var y=this.parseSig(A);w=y.r;t=y.s}else{if("object"===typeof A&&A.r&&A.s){w=A.r;t=A.s}else{throw"Invalid value for signature"}}var v;if(u instanceof ECPointFp){v=u}else{if(Bitcoin.Util.isArray(u)){v=h.decodeFrom(this.ecparams.curve,u)}else{throw"Invalid format for pubkey value, must be byte array or ECPointFp"}}var x=f.fromByteArrayUnsigned(z);return this.verifyRaw(x,w,t,v)};this.verifyRaw=function(z,t,E,y){var x=this.ecparams.n;var D=this.ecparams.G;if(t.compareTo(f.ONE)<0||t.compareTo(x)>=0){return false}if(E.compareTo(f.ONE)<0||E.compareTo(x)>=0){return false}var A=E.modInverse(x);var w=z.multiply(A).mod(x);var u=t.multiply(A).mod(x);var B=D.multiply(w).add(y.multiply(u));var C=B.getX().toBigInteger().mod(x);return C.equals(t)};this.serializeSig=function(v,u){var w=v.toByteArraySigned();var t=u.toByteArraySigned();var x=[];x.push(2);x.push(w.length);x=x.concat(w);x.push(2);x.push(t.length);x=x.concat(t);x.unshift(x.length);x.unshift(48);return x};this.parseSig=function(y){var x;if(y[0]!=48){throw new Error("Signature not a valid DERSequence")}x=2;if(y[x]!=2){throw new Error("First element in signature must be a DERInteger")}var w=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];if(y[x]!=2){throw new Error("Second element in signature must be a DERInteger")}var t=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];var v=f.fromByteArrayUnsigned(w);var u=f.fromByteArrayUnsigned(t);return{r:v,s:u}};this.parseSigCompact=function(w){if(w.length!==65){throw"Signature has the wrong length"}var t=w[0]-27;if(t<0||t>7){throw"Invalid signature type"}var x=this.ecparams.n;var v=f.fromByteArrayUnsigned(w.slice(1,33)).mod(x);var u=f.fromByteArrayUnsigned(w.slice(33,65)).mod(x);return{r:v,s:u,i:t}};this.readPKCS5PrvKeyHex=function(u){if(k(u)===false){throw new Error("not ASN.1 hex string")}var r,t,v;try{r=n(u,0,["[0]",0],"06");t=n(u,0,[1],"04");try{v=n(u,0,["[1]",0],"03")}catch(s){}}catch(s){throw new Error("malformed PKCS#1/5 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v);this.setPrivateKeyHex(t);this.isPublic=false};this.readPKCS8PrvKeyHex=function(v){if(k(v)===false){throw new j("not ASN.1 hex string")}var t,r,u,w;try{t=n(v,0,[1,0],"06");r=n(v,0,[1,1],"06");u=n(v,0,[2,0,1],"04");try{w=n(v,0,[2,0,"[1]",0],"03")}catch(s){}}catch(s){throw new j("malformed PKCS#8 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(w);this.setPrivateKeyHex(u);this.isPublic=false};this.readPKCS8PubKeyHex=function(u){if(k(u)===false){throw new j("not ASN.1 hex string")}var t,r,v;try{t=n(u,0,[0,0],"06");r=n(u,0,[0,1],"06");v=n(u,0,[1],"03")}catch(s){throw new j("malformed PKCS#8 ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v)};this.readCertPubKeyHex=function(t,v){if(k(t)===false){throw new j("not ASN.1 hex string")}var r,u;try{r=n(t,0,[0,5,0,1],"06");u=n(t,0,[0,5,1],"03")}catch(s){throw new j("malformed X.509 certificate ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(u)};if(e!==undefined){if(e.curve!==undefined){this.curveName=e.curve}}if(this.curveName===undefined){this.curveName=g}this.setNamedCurve(this.curveName);if(e!==undefined){if(e.prv!==undefined){this.setPrivateKeyHex(e.prv)}if(e.pub!==undefined){this.setPublicKeyHex(e.pub)}}};KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a);var d=new BigInteger(b.r,16);var c=new BigInteger(b.s,16);return{r:d,s:c}};KJUR.crypto.ECDSA.parseSigHexInHexRS=function(f){var j=ASN1HEX,i=j.getChildIdx,g=j.getV;j.checkStrictDER(f,0);if(f.substr(0,2)!="30"){throw new Error("signature is not a ASN.1 sequence")}var h=i(f,0);if(h.length!=2){throw new Error("signature shall have two elements")}var e=h[0];var d=h[1];if(f.substr(e,2)!="02"){throw new Error("1st item not ASN.1 integer")}if(f.substr(d,2)!="02"){throw new Error("2nd item not ASN.1 integer")}var c=g(f,e);var b=g(f,d);return{r:c,s:b}};KJUR.crypto.ECDSA.asn1SigToConcatSig=function(d){var e=KJUR.crypto.ECDSA.parseSigHexInHexRS(d);var b=e.r;var a=e.s;if(b.length>=130&&b.length<=134){if(b.length%2!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%2!=0){throw Error("unknown ECDSA sig s length error")}if(b.substr(0,2)=="00"){b=b.substr(2)}if(a.substr(0,2)=="00"){a=a.substr(2)}var c=Math.max(b.length,a.length);b=("000000"+b).slice(-c);a=("000000"+a).slice(-c);return b+a}if(b.substr(0,2)=="00"&&(b.length%32)==2){b=b.substr(2)}if(a.substr(0,2)=="00"&&(a.length%32)==2){a=a.substr(2)}if((b.length%32)==30){b="00"+b}if((a.length%32)==30){a="00"+a}if(b.length%32!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%32!=0){throw Error("unknown ECDSA sig s length error")}return b+a};KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length%4!=0){throw Error("unknown ECDSA concatinated r-s sig length error")}var c=a.substr(0,a.length/2);var b=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(c,b)};KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(b,a){var d=new BigInteger(b,16);var c=new BigInteger(a,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(d,c)};KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(f,d){var c=KJUR.asn1;var b=new c.DERInteger({bigint:f});var a=new c.DERInteger({bigint:d});var e=new c.DERSequence({array:[b,a]});return e.tohex()};KJUR.crypto.ECDSA.getName=function(a){if(a==="2b8104001f"){return"secp192k1"}if(a==="2a8648ce3d030107"){return"secp256r1"}if(a==="2b8104000a"){return"secp256k1"}if(a==="2b81040021"){return"secp224r1"}if(a==="2b81040022"){return"secp384r1"}if(a==="2b81040023"){return"secp521r1"}if("|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(a)!==-1){return"secp256r1"}if("|secp256k1|".indexOf(a)!==-1){return"secp256k1"}if("|secp224r1|NIST P-224|P-224|".indexOf(a)!==-1){return"secp224r1"}if("|secp384r1|NIST P-384|P-384|".indexOf(a)!==-1){return"secp384r1"}if("|secp521r1|NIST P-521|P-521|".indexOf(a)!==-1){return"secp521r1"}return null}; if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.crypto=="undefined"||!KJUR.crypto){KJUR.crypto={}}KJUR.crypto.ECParameterDB=new function(){var b={};var c={};function a(d){return new BigInteger(d,16)}this.getByName=function(e){var d=e;if(typeof c[d]!="undefined"){d=c[e]}if(typeof b[d]!="undefined"){return b[d]}throw"unregistered EC curve name: "+d};this.regist=function(A,l,o,g,m,e,j,f,k,u,d,x){b[A]={};var s=a(o);var z=a(g);var y=a(m);var t=a(e);var w=a(j);var r=new ECCurveFp(s,z,y);var q=r.decodePointHex("04"+f+k);b[A]["name"]=A;b[A]["keylen"]=l;b[A]["keycharlen"]=Math.ceil(l/8)*2;b[A]["curve"]=r;b[A]["G"]=q;b[A]["n"]=t;b[A]["h"]=w;b[A]["oid"]=d;b[A]["info"]=x;for(var v=0;v1){l=new BigInteger(n,16)}else{l=null}m=new BigInteger(o,16);this.setPrivate(h,f,j,l,m)};this.setPublic=function(i,h,f,j){this.isPublic=true;this.p=i;this.q=h;this.g=f;this.y=j;this.x=null};this.setPublicHex=function(k,j,i,l){var g,f,m,h;g=new BigInteger(k,16);f=new BigInteger(j,16);m=new BigInteger(i,16);h=new BigInteger(l,16);this.setPublic(g,f,m,h)};this.signWithMessageHash=function(j){var i=this.p;var h=this.q;var m=this.g;var o=this.y;var t=this.x;var l=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),h.subtract(BigInteger.ONE));var u=j.substr(0,h.bitLength()/4);var n=new BigInteger(u,16);var f=(m.modPow(l,i)).mod(h);var w=(l.modInverse(h).multiply(n.add(t.multiply(f)))).mod(h);var v=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:f}},{"int":{bigint:w}}]});return v};this.verifyWithMessageHash=function(m,l){var j=this.p;var h=this.q;var o=this.g;var u=this.y;var n=this.parseASN1Signature(l);var f=n[0];var C=n[1];var B=m.substr(0,h.bitLength()/4);var t=new BigInteger(B,16);if(BigInteger.ZERO.compareTo(f)>0||f.compareTo(h)>0){throw"invalid DSA signature"}if(BigInteger.ZERO.compareTo(C)>=0||C.compareTo(h)>0){throw"invalid DSA signature"}var x=C.modInverse(h);var k=t.multiply(x).mod(h);var i=f.multiply(x).mod(h);var A=o.modPow(k,j).multiply(u.modPow(i,j)).mod(j).mod(h);return A.compareTo(f)==0};this.parseASN1Signature=function(f){try{var i=new c(d(f,0,[0],"02"),16);var h=new c(d(f,0,[1],"02"),16);return[i,h]}catch(g){throw new Error("malformed ASN.1 DSA signature")}};this.readPKCS5PrvKeyHex=function(j){var k,i,g,l,m;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1],"02");i=d(j,0,[2],"02");g=d(j,0,[3],"02");l=d(j,0,[4],"02");m=d(j,0,[5],"02")}catch(f){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(k,i,g,l,m)};this.readPKCS8PrvKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1,1,0],"02");i=d(j,0,[1,1,1],"02");g=d(j,0,[1,1,2],"02");l=d(j,0,[2,0],"02")}catch(f){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(k,i,g,null,l)};this.readPKCS8PubKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,1,0],"02");i=d(j,0,[0,1,1],"02");g=d(j,0,[0,1,2],"02");l=d(j,0,[1,0],"02")}catch(f){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(k,i,g,l)};this.readCertPubKeyHex=function(j,m){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,5,0,1,0],"02");i=d(j,0,[0,5,0,1,1],"02");g=d(j,0,[0,5,0,1,2],"02");l=d(j,0,[0,5,1,0],"02")}catch(f){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(k,i,g,l)}}; diff --git a/jsrsasign-jwths-min.js b/jsrsasign-jwths-min.js index ee3b9e3d..0a90e1fa 100644 --- a/jsrsasign-jwths-min.js +++ b/jsrsasign-jwths-min.js @@ -1,8 +1,8 @@ /* - * jsrsasign(jwths) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license + * jsrsasign(jwths) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license */ -var VERSION = "11.0.0"; -var VERSION_FULL = "jsrsasign(jwths) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; +var VERSION = "11.1.0"; +var VERSION_FULL = "jsrsasign(jwths) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; /*! CryptoJS v3.1.2 core-fix.js * code.google.com/p/crypto-js @@ -114,5 +114,5 @@ var rng_state;var rng_pool;var rng_pptr;function rng_seed_int(a){rng_pool[rng_pp */ var jsonParse=(function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)";var j='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';var i='(?:"'+j+'*")';var d=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+i+")","g");var k=new RegExp("\\\\(?:([^u])|u(.{4}))","g");var g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function h(l,m,n){return m?g[m]:String.fromCharCode(parseInt(n,16))}var c=new String("");var a="\\";var f={"{":Object,"[":Array};var b=Object.hasOwnProperty;return function(u,q){var p=u.match(d);var x;var v=p[0];var l=false;if("{"===v){x={}}else{if("["===v){x=[]}else{x=[];l=true}}var t;var r=[x];for(var o=1-l,m=p.length;o=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); var KJUR;if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.lang=="undefined"||!KJUR.lang){KJUR.lang={}}KJUR.lang.String=function(){};function Base64x(){}function stoBA(d){var b=new Array();for(var c=0;c>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f0){var b=":"+n.join(":")+":";if(b.indexOf(":"+k+":")==-1){throw"algorithm '"+k+"' not accepted in the list"}}if(k!="none"&&B===null){throw"key shall be specified to verify."}if(typeof B=="string"&&B.indexOf("-----BEGIN ")!=-1){B=KEYUTIL.getKey(B)}if(z=="RS"||z=="PS"){if(!(B instanceof m)){throw"key shall be a RSAKey obj for RS* and PS* algs"}}if(z=="ES"){if(!(B instanceof p)){throw"key shall be a ECDSA obj for ES* algs"}}if(k=="none"){}var u=null;if(t.jwsalg2sigalg[l.alg]===undefined){throw"unsupported alg name: "+k}else{u=t.jwsalg2sigalg[k]}if(u=="none"){throw"not supported"}else{if(u.substr(0,4)=="Hmac"){var o=null;if(B===undefined){throw"hexadecimal key shall be specified for HMAC"}var j=new s({alg:u,pass:B});j.updateString(c);o=j.doFinal();return A==o}else{if(u.indexOf("withECDSA")!=-1){var h=null;try{h=p.concatSigToASN1Sig(A)}catch(v){return false}var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(h)}else{var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(A)}}}};KJUR.jws.JWS.parse=function(g){var c=g.split(".");var b={};var f,e,d;if(c.length!=2&&c.length!=3){throw"malformed sJWS: wrong number of '.' splitted elements"}f=c[0];e=c[1];if(c.length==3){d=c[2]}b.headerObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(f));b.payloadObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(e));b.headerPP=JSON.stringify(b.headerObj,null," ");if(b.payloadObj==null){b.payloadPP=b64utoutf8(e)}else{b.payloadPP=JSON.stringify(b.payloadObj,null," ")}if(d!==undefined){b.sigHex=b64utohex(d)}return b};KJUR.jws.JWS.verifyJWT=function(e,l,r){var d=KJUR,j=d.jws,o=j.JWS,n=o.readSafeJSONString,p=o.inArray,f=o.includedArray;if(!isBase64URLDot(e)){return false}var k=e.split(".");if(k.length!=3){return false}var c=k[0];var i=k[1];var q=c+"."+i;var m=b64utohex(k[2]);var h=n(b64utoutf8(c));var g=n(b64utoutf8(i));if(h.alg===undefined){return false}if(r.alg===undefined){throw"acceptField.alg shall be specified"}if(!p(h.alg,r.alg)){return false}if(g.iss!==undefined&&typeof r.iss==="object"){if(!p(g.iss,r.iss)){return false}}if(g.sub!==undefined&&typeof r.sub==="object"){if(!p(g.sub,r.sub)){return false}}if(g.aud!==undefined&&typeof r.aud==="object"){if(typeof g.aud=="string"){if(!p(g.aud,r.aud)){return false}}else{if(typeof g.aud=="object"){if(!f(g.aud,r.aud)){return false}}}}var b=j.IntDate.getNow();if(r.verifyAt!==undefined&&typeof r.verifyAt==="number"){b=r.verifyAt}if(r.gracePeriod===undefined||typeof r.gracePeriod!=="number"){r.gracePeriod=0}if(g.exp!==undefined&&typeof g.exp=="number"){if(g.exp+r.gracePeriod15){throw new Error("ASN.1 length too long to represent by 8x: n = "+j.toString(16))}var g=128+h;return g.toString(16)+i}};this.tohex=function(){if(this.hTLV==null||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getEncodedHex=function(){return this.tohex()};this.getValueHex=function(){this.tohex();return this.hV};this.getFreshValueHex=function(){return""};this.setByParam=function(g){this.params=g};if(e!=undefined){if(e.tlv!=undefined){this.hTLV=e.tlv;this.isModified=false}}};KJUR.asn1.DERAbstractString=function(c){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var b=null;var a=null;this.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=utf8tohex(this.s).toLowerCase()};this.setStringHex=function(d){this.hTLV=null;this.isModified=true;this.s=null;this.hV=d};this.getFreshValueHex=function(){return this.hV};if(typeof c!="undefined"){if(typeof c=="string"){this.setString(c)}else{if(typeof c.str!="undefined"){this.setString(c.str)}else{if(typeof c.hex!="undefined"){this.setStringHex(c.hex)}}}}};extendClass(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(c){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);var b=null;var a=null;this.localDateToUTC=function(g){var e=g.getTime()+(g.getTimezoneOffset()*60000);var f=new Date(e);return f};this.formatDate=function(m,o,e){var g=this.zeroPadding;var n=this.localDateToUTC(m);var p=String(n.getFullYear());if(o=="utc"){p=p.substr(2,2)}var l=g(String(n.getMonth()+1),2);var q=g(String(n.getDate()),2);var h=g(String(n.getHours()),2);var i=g(String(n.getMinutes()),2);var j=g(String(n.getSeconds()),2);var r=p+l+q+h+i+j;if(e===true){var f=n.getMilliseconds();if(f!=0){var k=g(String(f),3);k=k.replace(/[0]+$/,"");r=r+"."+k}}return r+"Z"};this.zeroPadding=function(e,d){if(e.length>=d){return e}return new Array(d-e.length+1).join("0")+e};this.setByParam=function(d){this.hV=null;this.hTLV=null;this.params=d};this.getString=function(){return undefined};this.setString=function(d){this.hTLV=null;this.isModified=true;if(this.params==undefined){this.params={}}this.params.str=d};this.setByDate=function(d){this.hTLV=null;this.isModified=true;if(this.params==undefined){this.params={}}this.params.date=d};this.setByDateValue=function(h,j,e,d,f,g){var i=new Date(Date.UTC(h,j-1,e,d,f,g,0));this.setByDate(i)};this.getFreshValueHex=function(){return this.hV}};extendClass(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=function(b){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var a=null;this.setByASN1ObjectArray=function(c){this.hTLV=null;this.isModified=true;this.asn1Array=c};this.appendASN1Object=function(c){this.hTLV=null;this.isModified=true;this.asn1Array.push(c)};this.asn1Array=new Array();if(typeof b!="undefined"){if(typeof b.array!="undefined"){this.asn1Array=b.array}}};extendClass(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(a){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";if(a==false){this.hTLV="010100"}else{this.hTLV="0101ff"}};extendClass(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(b){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.params=null;var a=twoscompl;this.setByBigInteger=function(c){this.isModified=true;this.params={bigint:c}};this.setByInteger=function(c){this.isModified=true;this.params=c};this.setValueHex=function(c){this.isModified=true;this.params={hex:c}};this.getFreshValueHex=function(){var d=this.params;var c=null;if(d==null){throw new Error("value not set")}if(typeof d=="object"&&d.hex!=undefined){this.hV=d.hex;return this.hV}if(typeof d=="number"){c=new BigInteger(String(d),10)}else{if(d["int"]!=undefined){c=new BigInteger(String(d["int"]),10)}else{if(d.bigint!=undefined){c=d.bigint}else{throw new Error("wrong parameter")}}}this.hV=a(c);return this.hV};if(b!=undefined){this.params=b}};extendClass(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(b){if(b!==undefined&&typeof b.obj!=="undefined"){var a=KJUR.asn1.ASN1Util.newObject(b.obj);b.hex="00"+a.tohex()}KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(c){this.hTLV=null;this.isModified=true;this.hV=c};this.setUnusedBitsAndHexValue=function(c,e){if(c<0||7=f){break}}return j};ASN1HEX.getNthChildIdx=function(d,b,e){var c=ASN1HEX.getChildIdx(d,b);return c[e]};ASN1HEX.getIdxbyList=function(e,d,c,i){var g=ASN1HEX;var f,b;if(c.length==0){if(i!==undefined){if(e.substr(d,2)!==i){return -1}}return d}f=c.shift();b=g.getChildIdx(e,d);if(f>=b.length){return -1}return g.getIdxbyList(e,b[f],c,i)};ASN1HEX.getIdxbyListEx=function(f,k,b,g){var m=ASN1HEX;var d,l;if(b.length==0){if(g!==undefined){if(f.substr(k,2)!==g){return -1}}return k}d=b.shift();l=m.getChildIdx(f,k);var j=0;for(var e=0;e=d.length){return null}return e.getTLV(d,a)};ASN1HEX.getTLVbyListEx=function(d,c,b,f){var e=ASN1HEX;var a=e.getIdxbyListEx(d,c,b,f);if(a==-1){return null}return e.getTLV(d,a)};ASN1HEX.getVbyList=function(e,c,b,g,i){var f=ASN1HEX;var a,d;a=f.getIdxbyList(e,c,b,g);if(a==-1){return null}if(a>=e.length){return null}d=f.getV(e,a);if(i===true){d=d.substr(2)}return d};ASN1HEX.getVbyListEx=function(b,e,a,d,f){var j=ASN1HEX;var g,c,i;g=j.getIdxbyListEx(b,e,a,d);if(g==-1){return null}i=j.getV(b,g);if(b.substr(g,2)=="03"&&f!==false){i=i.substr(2)}return i};ASN1HEX.getInt=function(e,b,f){if(f==undefined){f=-1}try{var c=e.substr(b,2);if(c!="02"&&c!="03"){return f}var a=ASN1HEX.getV(e,b);if(c=="02"){return parseInt(a,16)}else{return bitstrtoint(a)}}catch(d){return f}};ASN1HEX.getOID=function(c,a,d){if(d==undefined){d=null}try{if(c.substr(a,2)!="06"){return d}var e=ASN1HEX.getV(c,a);return hextooid(e)}catch(b){return d}};ASN1HEX.getOIDName=function(d,a,f){if(f==undefined){f=null}try{var e=ASN1HEX.getOID(d,a,f);if(e==f){return f}var b=KJUR.asn1.x509.OID.oid2name(e);if(b==""){return e}return b}catch(c){return f}};ASN1HEX.getString=function(d,b,e){if(e==undefined){e=null}try{var a=ASN1HEX.getV(d,b);return hextorstr(a)}catch(c){return e}};ASN1HEX.hextooidstr=function(e){var h=function(b,a){if(b.length>=a){return b}return new Array(a-b.length+1).join("0")+b};var l=[];var o=e.substr(0,2);var f=parseInt(o,16);l[0]=new String(Math.floor(f/40));l[1]=new String(f%40);var m=e.substr(2);var k=[];for(var g=0;g0){n=n+"."+j.join(".")}return n};ASN1HEX.dump=function(t,c,l,g){var p=ASN1HEX;var j=p.getV;var y=p.dump;var w=p.getChildIdx;var e=t;if(t instanceof KJUR.asn1.ASN1Object){e=t.tohex()}var q=function(A,i){if(A.length<=i*2){return A}else{var v=A.substr(0,i)+"..(total "+A.length/2+"bytes).."+A.substr(A.length-i,i);return v}};if(c===undefined){c={ommit_long_octet:32}}if(l===undefined){l=0}if(g===undefined){g=""}var x=c.ommit_long_octet;var z=e.substr(l,2);if(z=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(z=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(z=="03"){var h=j(e,l);if(p.isASN1HEX(h.substr(2))){var k=g+"BITSTRING, encapsulates\n";k=k+y(h.substr(2),c,0,g+" ");return k}else{return g+"BITSTRING "+q(h,x)+"\n"}}if(z=="04"){var h=j(e,l);if(p.isASN1HEX(h)){var k=g+"OCTETSTRING, encapsulates\n";k=k+y(h,c,0,g+" ");return k}else{return g+"OCTETSTRING "+q(h,x)+"\n"}}if(z=="05"){return g+"NULL\n"}if(z=="06"){var m=j(e,l);var b=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(b);var a=b.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+a+")\n"}else{return g+"ObjectIdentifier ("+a+")\n"}}if(z=="0a"){return g+"ENUMERATED "+parseInt(j(e,l))+"\n"}if(z=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(z=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(z=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(z=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(z=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(z=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(z=="1a"){return g+"VisualString '"+hextoutf8(j(e,l))+"'\n"}if(z=="1e"){return g+"BMPString '"+ucs2hextoutf8(j(e,l))+"'\n"}if(z=="30"){if(e.substr(l,4)=="3000"){return g+"SEQUENCE {}\n"}var k=g+"SEQUENCE\n";var d=w(e,l);var f=c;if((d.length==2||d.length==3)&&e.substr(d[0],2)=="06"&&e.substr(d[d.length-1],2)=="04"){var o=p.oidname(j(e,d[0]));var r=JSON.parse(JSON.stringify(c));r.x509ExtName=o;f=r}for(var u=0;u4){return{"enum":{hex:p}}}else{return{"enum":parseInt(p,16)}}}else{if(C=="30"||C=="31"){j[c[C]]=u(x);return j}else{if(C=="14"){var o=q(p);j[c[C]]={str:o};return j}else{if(C=="1e"){var o=n(p);j[c[C]]={str:o};return j}else{if(":0c:12:13:16:17:18:1a:".indexOf(C)!=-1){var o=k(p);j[c[C]]={str:o};return j}else{if(C.match(/^8[0-9]$/)){var o=k(p);if(o==null|o==""){return{tag:{tag:C,explicit:false,hex:p}}}else{if(o.match(/[\x00-\x1F\x7F-\x9F]/)!=null||o.match(/[\u0000-\u001F\u0080–\u009F]/)!=null){return{tag:{tag:C,explicit:false,hex:p}}}else{return{tag:{tag:C,explicit:false,str:o}}}}}else{if(C.match(/^a[0-9]$/)){try{if(!a(p)){throw new Error("not encap")}return{tag:{tag:C,explicit:true,obj:f(p)}}}catch(z){return{tag:{tag:C,explicit:true,hex:p}}}}else{var A=new KJUR.asn1.ASN1Object();A.hV=p;var w=A.getLengthHexFromValue();return{asn1:{tlv:C+w+p}}}}}}}}}}}}}}}};ASN1HEX.isContextTag=function(c,b){c=c.toLowerCase();var f,e;try{f=parseInt(c,16)}catch(d){return -1}if(b===undefined){if((f&192)==128){return true}else{return false}}try{var a=b.match(/^\[[0-9]+\]$/);if(a==null){return false}e=parseInt(b.substr(1,b.length-1),10);if(e>31){return false}if(((f&192)==128)&&((f&31)==e)){return true}return false}catch(d){return false}};ASN1HEX.isASN1HEX=function(e){var d=ASN1HEX;if(e.length%2==1){return false}var c=d.getVblen(e,0);var b=e.substr(0,2);var f=d.getL(e,0);var a=e.length-b.length-f.length;if(a==c*2){return true}return false};ASN1HEX.checkStrictDER=function(g,o,d,c,r){var s=ASN1HEX;if(d===undefined){if(typeof g!="string"){throw new Error("not hex string")}g=g.toLowerCase();if(!KJUR.lang.String.isHex(g)){throw new Error("not hex string")}d=g.length;c=g.length/2;if(c<128){r=1}else{r=Math.ceil(c.toString(16))+1}}var k=s.getL(g,o);if(k.length>r*2){throw new Error("L of TLV too long: idx="+o)}var n=s.getVblen(g,o);if(n>c){throw new Error("value of L too long than hex: idx="+o)}var q=s.getTLV(g,o);var f=q.length-2-s.getL(g,o).length;if(f!==(n*2)){throw new Error("V string length and L's value not the same:"+f+"/"+(n*2))}if(o===0){if(g.length!=q.length){throw new Error("total length and TLV length unmatch:"+g.length+"!="+q.length)}}var b=g.substr(o,2);if(b==="02"){var a=s.getVidx(g,o);if(g.substr(a,2)=="00"&&g.charCodeAt(a+2)<56){throw new Error("not least zeros for DER INTEGER")}}if(parseInt(b,16)&32){var p=s.getVblen(g,o);var m=0;var l=s.getChildIdx(g,o);for(var e=0;e>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f>24,(d&16711680)>>16,(d&65280)>>8,d&255]))));d+=1}return b}RSAKey.prototype.signPSS=function(e,a,d){var c=function(f){return KJUR.crypto.Util.hashHex(f,a)};var b=c(rstrtohex(e));if(d===undefined){d=-1}return this.signWithMessageHashPSS(b,a,d)};RSAKey.prototype.signWithMessageHashPSS=function(l,a,k){var b=hextorstr(l);var g=b.length;var m=this.n.bitLength()-1;var c=Math.ceil(m/8);var d;var o=function(i){return KJUR.crypto.Util.hashHex(i,a)};if(k===-1||k===undefined){k=g}else{if(k===-2){k=c-g-2}else{if(k<-2){throw new Error("invalid salt length")}}}if(c<(g+k+2)){throw new Error("data too long")}var f="";if(k>0){f=new Array(k);new SecureRandom().nextBytes(f);f=String.fromCharCode.apply(String,f)}var n=hextorstr(o(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+b+f)));var j=[];for(d=0;d>(8*c-m))&255;q[0]&=~p;for(d=0;dk){return false}var j=this.doPublic(b);var i=j.toString(16);if(i.length+3!=k/4){return false}var e=i.replace(/^1f+00/,"");var g=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(g.length==0){return false}var d=g[0];var h=g[1];var a=function(m){return KJUR.crypto.Util.hashString(m,d)};var c=a(f);return(h==c)};RSAKey.prototype.verifyWithMessageHash=function(e,a){if(a.length!=Math.ceil(this.n.bitLength()/4)){return false}var b=parseBigInt(a,16);if(b.bitLength()>this.n.bitLength()){return 0}var h=this.doPublic(b);var g=h.toString(16).replace(/^1f+00/,"");var c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(g);if(c.length==0){return false}var d=c[0];var f=c[1];return(f==e)};RSAKey.prototype.verifyPSS=function(c,b,a,f){var e=function(g){return KJUR.crypto.Util.hashHex(g,a)};var d=e(rstrtohex(c));if(f===undefined){f=-1}return this.verifyWithMessageHashPSS(d,b,a,f)};RSAKey.prototype.verifyWithMessageHashPSS=function(f,s,l,c){if(s.length!=Math.ceil(this.n.bitLength()/4)){return false}var k=new BigInteger(s,16);var r=function(i){return KJUR.crypto.Util.hashHex(i,l)};var j=hextorstr(f);var h=j.length;var g=this.n.bitLength()-1;var m=Math.ceil(g/8);var q;if(c===-1||c===undefined){c=h}else{if(c===-2){c=m-h-2}else{if(c<-2){throw new Error("invalid salt length")}}}if(m<(h+c+2)){throw new Error("data too long")}var a=this.doPublic(k).toByteArray();for(q=0;q>(8*m-g))&255;if((d.charCodeAt(0)&p)!==0){throw new Error("bits beyond keysize not zero")}var n=pss_mgf1_str(e,d.length,r);var o=[];for(q=0;qd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f=0;--u){v=v.twice2D();v.z=f.ONE;if(t.testBit(u)){if(s.testBit(u)){v=v.add2D(y)}else{v=v.add2D(x)}}else{if(s.testBit(u)){v=v.add2D(w)}}}return v}this.getBigRandom=function(r){return new f(r.bitLength(),a).mod(r.subtract(f.ONE)).add(f.ONE)};this.setNamedCurve=function(r){this.ecparams=c.getByName(r);this.prvKeyHex=null;this.pubKeyHex=null;this.curveName=r};this.setPrivateKeyHex=function(r){this.isPrivate=true;this.prvKeyHex=r};this.setPublicKeyHex=function(r){this.isPublic=true;this.pubKeyHex=r};this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if(t.substr(0,2)!=="04"){throw"this method supports uncompressed format(04) only"}var s=this.ecparams.keycharlen;if(t.length!==2+s*2){throw"malformed public key hex length"}var r={};r.x=t.substr(2,s);r.y=t.substr(2+s);return r};this.getShortNISTPCurveName=function(){var r=this.curveName;if(r==="secp256r1"||r==="NIST P-256"||r==="P-256"||r==="prime256v1"){return"P-256"}if(r==="secp384r1"||r==="NIST P-384"||r==="P-384"){return"P-384"}if(r==="secp521r1"||r==="NIST P-521"||r==="P-521"){return"P-521"}return null};this.generateKeyPairHex=function(){var s=this.ecparams.n;var u=this.getBigRandom(s);var r=this.ecparams.keycharlen;var t=("0000000000"+u.toString(16)).slice(-r);this.setPrivateKeyHex(t);var v=this.generatePublicKeyHex();return{ecprvhex:t,ecpubhex:v}};this.generatePublicKeyHex=function(){var u=new f(this.prvKeyHex,16);var w=this.ecparams.G.multiply(u);var t=w.getX().toBigInteger();var s=w.getY().toBigInteger();var r=this.ecparams.keycharlen;var y=("0000000000"+t.toString(16)).slice(-r);var v=("0000000000"+s.toString(16)).slice(-r);var x="04"+y+v;this.setPublicKeyHex(x);return x};this.signWithMessageHash=function(r){return this.signHex(r,this.prvKeyHex)};this.signHex=function(x,u){var A=new f(u,16);var v=this.ecparams.n;var z=new f(x.substring(0,this.ecparams.keycharlen),16);do{var w=this.getBigRandom(v);var B=this.ecparams.G;var y=B.multiply(w);var t=y.getX().toBigInteger().mod(v)}while(t.compareTo(f.ZERO)<=0);var C=w.modInverse(v).multiply(z.add(A.multiply(t))).mod(v);return m.biRSSigToASN1Sig(t,C)};this.sign=function(w,B){var z=B;var u=this.ecparams.n;var y=f.fromByteArrayUnsigned(w);do{var v=this.getBigRandom(u);var A=this.ecparams.G;var x=A.multiply(v);var t=x.getX().toBigInteger().mod(u)}while(t.compareTo(BigInteger.ZERO)<=0);var C=v.modInverse(u).multiply(y.add(z.multiply(t))).mod(u);return this.serializeSig(t,C)};this.verifyWithMessageHash=function(s,r){return this.verifyHex(s,r,this.pubKeyHex)};this.verifyHex=function(v,y,u){try{var t,B;var w=m.parseSigHex(y);t=w.r;B=w.s;var x=h.decodeFromHex(this.ecparams.curve,u);var z=new f(v.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(z,t,B,x)}catch(A){return false}};this.verify=function(z,A,u){var w,t;if(Bitcoin.Util.isArray(A)){var y=this.parseSig(A);w=y.r;t=y.s}else{if("object"===typeof A&&A.r&&A.s){w=A.r;t=A.s}else{throw"Invalid value for signature"}}var v;if(u instanceof ECPointFp){v=u}else{if(Bitcoin.Util.isArray(u)){v=h.decodeFrom(this.ecparams.curve,u)}else{throw"Invalid format for pubkey value, must be byte array or ECPointFp"}}var x=f.fromByteArrayUnsigned(z);return this.verifyRaw(x,w,t,v)};this.verifyRaw=function(z,t,E,y){var x=this.ecparams.n;var D=this.ecparams.G;if(t.compareTo(f.ONE)<0||t.compareTo(x)>=0){return false}if(E.compareTo(f.ONE)<0||E.compareTo(x)>=0){return false}var A=E.modInverse(x);var w=z.multiply(A).mod(x);var u=t.multiply(A).mod(x);var B=D.multiply(w).add(y.multiply(u));var C=B.getX().toBigInteger().mod(x);return C.equals(t)};this.serializeSig=function(v,u){var w=v.toByteArraySigned();var t=u.toByteArraySigned();var x=[];x.push(2);x.push(w.length);x=x.concat(w);x.push(2);x.push(t.length);x=x.concat(t);x.unshift(x.length);x.unshift(48);return x};this.parseSig=function(y){var x;if(y[0]!=48){throw new Error("Signature not a valid DERSequence")}x=2;if(y[x]!=2){throw new Error("First element in signature must be a DERInteger")}var w=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];if(y[x]!=2){throw new Error("Second element in signature must be a DERInteger")}var t=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];var v=f.fromByteArrayUnsigned(w);var u=f.fromByteArrayUnsigned(t);return{r:v,s:u}};this.parseSigCompact=function(w){if(w.length!==65){throw"Signature has the wrong length"}var t=w[0]-27;if(t<0||t>7){throw"Invalid signature type"}var x=this.ecparams.n;var v=f.fromByteArrayUnsigned(w.slice(1,33)).mod(x);var u=f.fromByteArrayUnsigned(w.slice(33,65)).mod(x);return{r:v,s:u,i:t}};this.readPKCS5PrvKeyHex=function(u){if(k(u)===false){throw new Error("not ASN.1 hex string")}var r,t,v;try{r=n(u,0,["[0]",0],"06");t=n(u,0,[1],"04");try{v=n(u,0,["[1]",0],"03")}catch(s){}}catch(s){throw new Error("malformed PKCS#1/5 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v);this.setPrivateKeyHex(t);this.isPublic=false};this.readPKCS8PrvKeyHex=function(v){if(k(v)===false){throw new j("not ASN.1 hex string")}var t,r,u,w;try{t=n(v,0,[1,0],"06");r=n(v,0,[1,1],"06");u=n(v,0,[2,0,1],"04");try{w=n(v,0,[2,0,"[1]",0],"03")}catch(s){}}catch(s){throw new j("malformed PKCS#8 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(w);this.setPrivateKeyHex(u);this.isPublic=false};this.readPKCS8PubKeyHex=function(u){if(k(u)===false){throw new j("not ASN.1 hex string")}var t,r,v;try{t=n(u,0,[0,0],"06");r=n(u,0,[0,1],"06");v=n(u,0,[1],"03")}catch(s){throw new j("malformed PKCS#8 ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v)};this.readCertPubKeyHex=function(t,v){if(k(t)===false){throw new j("not ASN.1 hex string")}var r,u;try{r=n(t,0,[0,5,0,1],"06");u=n(t,0,[0,5,1],"03")}catch(s){throw new j("malformed X.509 certificate ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(u)};if(e!==undefined){if(e.curve!==undefined){this.curveName=e.curve}}if(this.curveName===undefined){this.curveName=g}this.setNamedCurve(this.curveName);if(e!==undefined){if(e.prv!==undefined){this.setPrivateKeyHex(e.prv)}if(e.pub!==undefined){this.setPublicKeyHex(e.pub)}}};KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a);var d=new BigInteger(b.r,16);var c=new BigInteger(b.s,16);return{r:d,s:c}};KJUR.crypto.ECDSA.parseSigHexInHexRS=function(f){var j=ASN1HEX,i=j.getChildIdx,g=j.getV;j.checkStrictDER(f,0);if(f.substr(0,2)!="30"){throw new Error("signature is not a ASN.1 sequence")}var h=i(f,0);if(h.length!=2){throw new Error("signature shall have two elements")}var e=h[0];var d=h[1];if(f.substr(e,2)!="02"){throw new Error("1st item not ASN.1 integer")}if(f.substr(d,2)!="02"){throw new Error("2nd item not ASN.1 integer")}var c=g(f,e);var b=g(f,d);return{r:c,s:b}};KJUR.crypto.ECDSA.asn1SigToConcatSig=function(d){var e=KJUR.crypto.ECDSA.parseSigHexInHexRS(d);var b=e.r;var a=e.s;if(b.length>=130&&b.length<=134){if(b.length%2!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%2!=0){throw Error("unknown ECDSA sig s length error")}if(b.substr(0,2)=="00"){b=b.substr(2)}if(a.substr(0,2)=="00"){a=a.substr(2)}var c=Math.max(b.length,a.length);b=("000000"+b).slice(-c);a=("000000"+a).slice(-c);return b+a}if(b.substr(0,2)=="00"&&(b.length%32)==2){b=b.substr(2)}if(a.substr(0,2)=="00"&&(a.length%32)==2){a=a.substr(2)}if((b.length%32)==30){b="00"+b}if((a.length%32)==30){a="00"+a}if(b.length%32!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%32!=0){throw Error("unknown ECDSA sig s length error")}return b+a};KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length%4!=0){throw Error("unknown ECDSA concatinated r-s sig length error")}var c=a.substr(0,a.length/2);var b=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(c,b)};KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(b,a){var d=new BigInteger(b,16);var c=new BigInteger(a,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(d,c)};KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(f,d){var c=KJUR.asn1;var b=new c.DERInteger({bigint:f});var a=new c.DERInteger({bigint:d});var e=new c.DERSequence({array:[b,a]});return e.tohex()};KJUR.crypto.ECDSA.getName=function(a){if(a==="2b8104001f"){return"secp192k1"}if(a==="2a8648ce3d030107"){return"secp256r1"}if(a==="2b8104000a"){return"secp256k1"}if(a==="2b81040021"){return"secp224r1"}if(a==="2b81040022"){return"secp384r1"}if(a==="2b81040023"){return"secp521r1"}if("|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(a)!==-1){return"secp256r1"}if("|secp256k1|".indexOf(a)!==-1){return"secp256k1"}if("|secp224r1|NIST P-224|P-224|".indexOf(a)!==-1){return"secp224r1"}if("|secp384r1|NIST P-384|P-384|".indexOf(a)!==-1){return"secp384r1"}if("|secp521r1|NIST P-521|P-521|".indexOf(a)!==-1){return"secp521r1"}return null}; if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.crypto=="undefined"||!KJUR.crypto){KJUR.crypto={}}KJUR.crypto.ECParameterDB=new function(){var b={};var c={};function a(d){return new BigInteger(d,16)}this.getByName=function(e){var d=e;if(typeof c[d]!="undefined"){d=c[e]}if(typeof b[d]!="undefined"){return b[d]}throw"unregistered EC curve name: "+d};this.regist=function(A,l,o,g,m,e,j,f,k,u,d,x){b[A]={};var s=a(o);var z=a(g);var y=a(m);var t=a(e);var w=a(j);var r=new ECCurveFp(s,z,y);var q=r.decodePointHex("04"+f+k);b[A]["name"]=A;b[A]["keylen"]=l;b[A]["keycharlen"]=Math.ceil(l/8)*2;b[A]["curve"]=r;b[A]["G"]=q;b[A]["n"]=t;b[A]["h"]=w;b[A]["oid"]=d;b[A]["info"]=x;for(var v=0;v1){l=new BigInteger(n,16)}else{l=null}m=new BigInteger(o,16);this.setPrivate(h,f,j,l,m)};this.setPublic=function(i,h,f,j){this.isPublic=true;this.p=i;this.q=h;this.g=f;this.y=j;this.x=null};this.setPublicHex=function(k,j,i,l){var g,f,m,h;g=new BigInteger(k,16);f=new BigInteger(j,16);m=new BigInteger(i,16);h=new BigInteger(l,16);this.setPublic(g,f,m,h)};this.signWithMessageHash=function(j){var i=this.p;var h=this.q;var m=this.g;var o=this.y;var t=this.x;var l=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),h.subtract(BigInteger.ONE));var u=j.substr(0,h.bitLength()/4);var n=new BigInteger(u,16);var f=(m.modPow(l,i)).mod(h);var w=(l.modInverse(h).multiply(n.add(t.multiply(f)))).mod(h);var v=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:f}},{"int":{bigint:w}}]});return v};this.verifyWithMessageHash=function(m,l){var j=this.p;var h=this.q;var o=this.g;var u=this.y;var n=this.parseASN1Signature(l);var f=n[0];var C=n[1];var B=m.substr(0,h.bitLength()/4);var t=new BigInteger(B,16);if(BigInteger.ZERO.compareTo(f)>0||f.compareTo(h)>0){throw"invalid DSA signature"}if(BigInteger.ZERO.compareTo(C)>=0||C.compareTo(h)>0){throw"invalid DSA signature"}var x=C.modInverse(h);var k=t.multiply(x).mod(h);var i=f.multiply(x).mod(h);var A=o.modPow(k,j).multiply(u.modPow(i,j)).mod(j).mod(h);return A.compareTo(f)==0};this.parseASN1Signature=function(f){try{var i=new c(d(f,0,[0],"02"),16);var h=new c(d(f,0,[1],"02"),16);return[i,h]}catch(g){throw new Error("malformed ASN.1 DSA signature")}};this.readPKCS5PrvKeyHex=function(j){var k,i,g,l,m;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1],"02");i=d(j,0,[2],"02");g=d(j,0,[3],"02");l=d(j,0,[4],"02");m=d(j,0,[5],"02")}catch(f){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(k,i,g,l,m)};this.readPKCS8PrvKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1,1,0],"02");i=d(j,0,[1,1,1],"02");g=d(j,0,[1,1,2],"02");l=d(j,0,[2,0],"02")}catch(f){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(k,i,g,null,l)};this.readPKCS8PubKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,1,0],"02");i=d(j,0,[0,1,1],"02");g=d(j,0,[0,1,2],"02");l=d(j,0,[1,0],"02")}catch(f){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(k,i,g,l)};this.readCertPubKeyHex=function(j,m){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,5,0,1,0],"02");i=d(j,0,[0,5,0,1,1],"02");g=d(j,0,[0,5,0,1,2],"02");l=d(j,0,[0,5,1,0],"02")}catch(f){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(k,i,g,l)}}; diff --git a/npm/lib/jsrsasign-jwths-min.js b/npm/lib/jsrsasign-jwths-min.js index ee3b9e3d..0a90e1fa 100644 --- a/npm/lib/jsrsasign-jwths-min.js +++ b/npm/lib/jsrsasign-jwths-min.js @@ -1,8 +1,8 @@ /* - * jsrsasign(jwths) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license + * jsrsasign(jwths) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license */ -var VERSION = "11.0.0"; -var VERSION_FULL = "jsrsasign(jwths) 11.0.0 (2024-01-16) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; +var VERSION = "11.1.0"; +var VERSION_FULL = "jsrsasign(jwths) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"; /*! CryptoJS v3.1.2 core-fix.js * code.google.com/p/crypto-js @@ -114,5 +114,5 @@ var rng_state;var rng_pool;var rng_pptr;function rng_seed_int(a){rng_pool[rng_pp */ var jsonParse=(function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)";var j='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';var i='(?:"'+j+'*")';var d=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+i+")","g");var k=new RegExp("\\\\(?:([^u])|u(.{4}))","g");var g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function h(l,m,n){return m?g[m]:String.fromCharCode(parseInt(n,16))}var c=new String("");var a="\\";var f={"{":Object,"[":Array};var b=Object.hasOwnProperty;return function(u,q){var p=u.match(d);var x;var v=p[0];var l=false;if("{"===v){x={}}else{if("["===v){x=[]}else{x=[];l=true}}var t;var r=[x];for(var o=1-l,m=p.length;o=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); var KJUR;if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.lang=="undefined"||!KJUR.lang){KJUR.lang={}}KJUR.lang.String=function(){};function Base64x(){}function stoBA(d){var b=new Array();for(var c=0;c>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f0){var b=":"+n.join(":")+":";if(b.indexOf(":"+k+":")==-1){throw"algorithm '"+k+"' not accepted in the list"}}if(k!="none"&&B===null){throw"key shall be specified to verify."}if(typeof B=="string"&&B.indexOf("-----BEGIN ")!=-1){B=KEYUTIL.getKey(B)}if(z=="RS"||z=="PS"){if(!(B instanceof m)){throw"key shall be a RSAKey obj for RS* and PS* algs"}}if(z=="ES"){if(!(B instanceof p)){throw"key shall be a ECDSA obj for ES* algs"}}if(k=="none"){}var u=null;if(t.jwsalg2sigalg[l.alg]===undefined){throw"unsupported alg name: "+k}else{u=t.jwsalg2sigalg[k]}if(u=="none"){throw"not supported"}else{if(u.substr(0,4)=="Hmac"){var o=null;if(B===undefined){throw"hexadecimal key shall be specified for HMAC"}var j=new s({alg:u,pass:B});j.updateString(c);o=j.doFinal();return A==o}else{if(u.indexOf("withECDSA")!=-1){var h=null;try{h=p.concatSigToASN1Sig(A)}catch(v){return false}var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(h)}else{var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(A)}}}};KJUR.jws.JWS.parse=function(g){var c=g.split(".");var b={};var f,e,d;if(c.length!=2&&c.length!=3){throw"malformed sJWS: wrong number of '.' splitted elements"}f=c[0];e=c[1];if(c.length==3){d=c[2]}b.headerObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(f));b.payloadObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(e));b.headerPP=JSON.stringify(b.headerObj,null," ");if(b.payloadObj==null){b.payloadPP=b64utoutf8(e)}else{b.payloadPP=JSON.stringify(b.payloadObj,null," ")}if(d!==undefined){b.sigHex=b64utohex(d)}return b};KJUR.jws.JWS.verifyJWT=function(e,l,r){var d=KJUR,j=d.jws,o=j.JWS,n=o.readSafeJSONString,p=o.inArray,f=o.includedArray;if(!isBase64URLDot(e)){return false}var k=e.split(".");if(k.length!=3){return false}var c=k[0];var i=k[1];var q=c+"."+i;var m=b64utohex(k[2]);var h=n(b64utoutf8(c));var g=n(b64utoutf8(i));if(h.alg===undefined){return false}if(r.alg===undefined){throw"acceptField.alg shall be specified"}if(!p(h.alg,r.alg)){return false}if(g.iss!==undefined&&typeof r.iss==="object"){if(!p(g.iss,r.iss)){return false}}if(g.sub!==undefined&&typeof r.sub==="object"){if(!p(g.sub,r.sub)){return false}}if(g.aud!==undefined&&typeof r.aud==="object"){if(typeof g.aud=="string"){if(!p(g.aud,r.aud)){return false}}else{if(typeof g.aud=="object"){if(!f(g.aud,r.aud)){return false}}}}var b=j.IntDate.getNow();if(r.verifyAt!==undefined&&typeof r.verifyAt==="number"){b=r.verifyAt}if(r.gracePeriod===undefined||typeof r.gracePeriod!=="number"){r.gracePeriod=0}if(g.exp!==undefined&&typeof g.exp=="number"){if(g.exp+r.gracePeriod15){throw new Error("ASN.1 length too long to represent by 8x: n = "+j.toString(16))}var g=128+h;return g.toString(16)+i}};this.tohex=function(){if(this.hTLV==null||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getEncodedHex=function(){return this.tohex()};this.getValueHex=function(){this.tohex();return this.hV};this.getFreshValueHex=function(){return""};this.setByParam=function(g){this.params=g};if(e!=undefined){if(e.tlv!=undefined){this.hTLV=e.tlv;this.isModified=false}}};KJUR.asn1.DERAbstractString=function(c){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var b=null;var a=null;this.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=utf8tohex(this.s).toLowerCase()};this.setStringHex=function(d){this.hTLV=null;this.isModified=true;this.s=null;this.hV=d};this.getFreshValueHex=function(){return this.hV};if(typeof c!="undefined"){if(typeof c=="string"){this.setString(c)}else{if(typeof c.str!="undefined"){this.setString(c.str)}else{if(typeof c.hex!="undefined"){this.setStringHex(c.hex)}}}}};extendClass(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(c){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);var b=null;var a=null;this.localDateToUTC=function(g){var e=g.getTime()+(g.getTimezoneOffset()*60000);var f=new Date(e);return f};this.formatDate=function(m,o,e){var g=this.zeroPadding;var n=this.localDateToUTC(m);var p=String(n.getFullYear());if(o=="utc"){p=p.substr(2,2)}var l=g(String(n.getMonth()+1),2);var q=g(String(n.getDate()),2);var h=g(String(n.getHours()),2);var i=g(String(n.getMinutes()),2);var j=g(String(n.getSeconds()),2);var r=p+l+q+h+i+j;if(e===true){var f=n.getMilliseconds();if(f!=0){var k=g(String(f),3);k=k.replace(/[0]+$/,"");r=r+"."+k}}return r+"Z"};this.zeroPadding=function(e,d){if(e.length>=d){return e}return new Array(d-e.length+1).join("0")+e};this.setByParam=function(d){this.hV=null;this.hTLV=null;this.params=d};this.getString=function(){return undefined};this.setString=function(d){this.hTLV=null;this.isModified=true;if(this.params==undefined){this.params={}}this.params.str=d};this.setByDate=function(d){this.hTLV=null;this.isModified=true;if(this.params==undefined){this.params={}}this.params.date=d};this.setByDateValue=function(h,j,e,d,f,g){var i=new Date(Date.UTC(h,j-1,e,d,f,g,0));this.setByDate(i)};this.getFreshValueHex=function(){return this.hV}};extendClass(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=function(b){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var a=null;this.setByASN1ObjectArray=function(c){this.hTLV=null;this.isModified=true;this.asn1Array=c};this.appendASN1Object=function(c){this.hTLV=null;this.isModified=true;this.asn1Array.push(c)};this.asn1Array=new Array();if(typeof b!="undefined"){if(typeof b.array!="undefined"){this.asn1Array=b.array}}};extendClass(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(a){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";if(a==false){this.hTLV="010100"}else{this.hTLV="0101ff"}};extendClass(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(b){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.params=null;var a=twoscompl;this.setByBigInteger=function(c){this.isModified=true;this.params={bigint:c}};this.setByInteger=function(c){this.isModified=true;this.params=c};this.setValueHex=function(c){this.isModified=true;this.params={hex:c}};this.getFreshValueHex=function(){var d=this.params;var c=null;if(d==null){throw new Error("value not set")}if(typeof d=="object"&&d.hex!=undefined){this.hV=d.hex;return this.hV}if(typeof d=="number"){c=new BigInteger(String(d),10)}else{if(d["int"]!=undefined){c=new BigInteger(String(d["int"]),10)}else{if(d.bigint!=undefined){c=d.bigint}else{throw new Error("wrong parameter")}}}this.hV=a(c);return this.hV};if(b!=undefined){this.params=b}};extendClass(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(b){if(b!==undefined&&typeof b.obj!=="undefined"){var a=KJUR.asn1.ASN1Util.newObject(b.obj);b.hex="00"+a.tohex()}KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(c){this.hTLV=null;this.isModified=true;this.hV=c};this.setUnusedBitsAndHexValue=function(c,e){if(c<0||7=f){break}}return j};ASN1HEX.getNthChildIdx=function(d,b,e){var c=ASN1HEX.getChildIdx(d,b);return c[e]};ASN1HEX.getIdxbyList=function(e,d,c,i){var g=ASN1HEX;var f,b;if(c.length==0){if(i!==undefined){if(e.substr(d,2)!==i){return -1}}return d}f=c.shift();b=g.getChildIdx(e,d);if(f>=b.length){return -1}return g.getIdxbyList(e,b[f],c,i)};ASN1HEX.getIdxbyListEx=function(f,k,b,g){var m=ASN1HEX;var d,l;if(b.length==0){if(g!==undefined){if(f.substr(k,2)!==g){return -1}}return k}d=b.shift();l=m.getChildIdx(f,k);var j=0;for(var e=0;e=d.length){return null}return e.getTLV(d,a)};ASN1HEX.getTLVbyListEx=function(d,c,b,f){var e=ASN1HEX;var a=e.getIdxbyListEx(d,c,b,f);if(a==-1){return null}return e.getTLV(d,a)};ASN1HEX.getVbyList=function(e,c,b,g,i){var f=ASN1HEX;var a,d;a=f.getIdxbyList(e,c,b,g);if(a==-1){return null}if(a>=e.length){return null}d=f.getV(e,a);if(i===true){d=d.substr(2)}return d};ASN1HEX.getVbyListEx=function(b,e,a,d,f){var j=ASN1HEX;var g,c,i;g=j.getIdxbyListEx(b,e,a,d);if(g==-1){return null}i=j.getV(b,g);if(b.substr(g,2)=="03"&&f!==false){i=i.substr(2)}return i};ASN1HEX.getInt=function(e,b,f){if(f==undefined){f=-1}try{var c=e.substr(b,2);if(c!="02"&&c!="03"){return f}var a=ASN1HEX.getV(e,b);if(c=="02"){return parseInt(a,16)}else{return bitstrtoint(a)}}catch(d){return f}};ASN1HEX.getOID=function(c,a,d){if(d==undefined){d=null}try{if(c.substr(a,2)!="06"){return d}var e=ASN1HEX.getV(c,a);return hextooid(e)}catch(b){return d}};ASN1HEX.getOIDName=function(d,a,f){if(f==undefined){f=null}try{var e=ASN1HEX.getOID(d,a,f);if(e==f){return f}var b=KJUR.asn1.x509.OID.oid2name(e);if(b==""){return e}return b}catch(c){return f}};ASN1HEX.getString=function(d,b,e){if(e==undefined){e=null}try{var a=ASN1HEX.getV(d,b);return hextorstr(a)}catch(c){return e}};ASN1HEX.hextooidstr=function(e){var h=function(b,a){if(b.length>=a){return b}return new Array(a-b.length+1).join("0")+b};var l=[];var o=e.substr(0,2);var f=parseInt(o,16);l[0]=new String(Math.floor(f/40));l[1]=new String(f%40);var m=e.substr(2);var k=[];for(var g=0;g0){n=n+"."+j.join(".")}return n};ASN1HEX.dump=function(t,c,l,g){var p=ASN1HEX;var j=p.getV;var y=p.dump;var w=p.getChildIdx;var e=t;if(t instanceof KJUR.asn1.ASN1Object){e=t.tohex()}var q=function(A,i){if(A.length<=i*2){return A}else{var v=A.substr(0,i)+"..(total "+A.length/2+"bytes).."+A.substr(A.length-i,i);return v}};if(c===undefined){c={ommit_long_octet:32}}if(l===undefined){l=0}if(g===undefined){g=""}var x=c.ommit_long_octet;var z=e.substr(l,2);if(z=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(z=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(z=="03"){var h=j(e,l);if(p.isASN1HEX(h.substr(2))){var k=g+"BITSTRING, encapsulates\n";k=k+y(h.substr(2),c,0,g+" ");return k}else{return g+"BITSTRING "+q(h,x)+"\n"}}if(z=="04"){var h=j(e,l);if(p.isASN1HEX(h)){var k=g+"OCTETSTRING, encapsulates\n";k=k+y(h,c,0,g+" ");return k}else{return g+"OCTETSTRING "+q(h,x)+"\n"}}if(z=="05"){return g+"NULL\n"}if(z=="06"){var m=j(e,l);var b=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(b);var a=b.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+a+")\n"}else{return g+"ObjectIdentifier ("+a+")\n"}}if(z=="0a"){return g+"ENUMERATED "+parseInt(j(e,l))+"\n"}if(z=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(z=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(z=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(z=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(z=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(z=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(z=="1a"){return g+"VisualString '"+hextoutf8(j(e,l))+"'\n"}if(z=="1e"){return g+"BMPString '"+ucs2hextoutf8(j(e,l))+"'\n"}if(z=="30"){if(e.substr(l,4)=="3000"){return g+"SEQUENCE {}\n"}var k=g+"SEQUENCE\n";var d=w(e,l);var f=c;if((d.length==2||d.length==3)&&e.substr(d[0],2)=="06"&&e.substr(d[d.length-1],2)=="04"){var o=p.oidname(j(e,d[0]));var r=JSON.parse(JSON.stringify(c));r.x509ExtName=o;f=r}for(var u=0;u4){return{"enum":{hex:p}}}else{return{"enum":parseInt(p,16)}}}else{if(C=="30"||C=="31"){j[c[C]]=u(x);return j}else{if(C=="14"){var o=q(p);j[c[C]]={str:o};return j}else{if(C=="1e"){var o=n(p);j[c[C]]={str:o};return j}else{if(":0c:12:13:16:17:18:1a:".indexOf(C)!=-1){var o=k(p);j[c[C]]={str:o};return j}else{if(C.match(/^8[0-9]$/)){var o=k(p);if(o==null|o==""){return{tag:{tag:C,explicit:false,hex:p}}}else{if(o.match(/[\x00-\x1F\x7F-\x9F]/)!=null||o.match(/[\u0000-\u001F\u0080–\u009F]/)!=null){return{tag:{tag:C,explicit:false,hex:p}}}else{return{tag:{tag:C,explicit:false,str:o}}}}}else{if(C.match(/^a[0-9]$/)){try{if(!a(p)){throw new Error("not encap")}return{tag:{tag:C,explicit:true,obj:f(p)}}}catch(z){return{tag:{tag:C,explicit:true,hex:p}}}}else{var A=new KJUR.asn1.ASN1Object();A.hV=p;var w=A.getLengthHexFromValue();return{asn1:{tlv:C+w+p}}}}}}}}}}}}}}}};ASN1HEX.isContextTag=function(c,b){c=c.toLowerCase();var f,e;try{f=parseInt(c,16)}catch(d){return -1}if(b===undefined){if((f&192)==128){return true}else{return false}}try{var a=b.match(/^\[[0-9]+\]$/);if(a==null){return false}e=parseInt(b.substr(1,b.length-1),10);if(e>31){return false}if(((f&192)==128)&&((f&31)==e)){return true}return false}catch(d){return false}};ASN1HEX.isASN1HEX=function(e){var d=ASN1HEX;if(e.length%2==1){return false}var c=d.getVblen(e,0);var b=e.substr(0,2);var f=d.getL(e,0);var a=e.length-b.length-f.length;if(a==c*2){return true}return false};ASN1HEX.checkStrictDER=function(g,o,d,c,r){var s=ASN1HEX;if(d===undefined){if(typeof g!="string"){throw new Error("not hex string")}g=g.toLowerCase();if(!KJUR.lang.String.isHex(g)){throw new Error("not hex string")}d=g.length;c=g.length/2;if(c<128){r=1}else{r=Math.ceil(c.toString(16))+1}}var k=s.getL(g,o);if(k.length>r*2){throw new Error("L of TLV too long: idx="+o)}var n=s.getVblen(g,o);if(n>c){throw new Error("value of L too long than hex: idx="+o)}var q=s.getTLV(g,o);var f=q.length-2-s.getL(g,o).length;if(f!==(n*2)){throw new Error("V string length and L's value not the same:"+f+"/"+(n*2))}if(o===0){if(g.length!=q.length){throw new Error("total length and TLV length unmatch:"+g.length+"!="+q.length)}}var b=g.substr(o,2);if(b==="02"){var a=s.getVidx(g,o);if(g.substr(a,2)=="00"&&g.charCodeAt(a+2)<56){throw new Error("not least zeros for DER INTEGER")}}if(parseInt(b,16)&32){var p=s.getVblen(g,o);var m=0;var l=s.getChildIdx(g,o);for(var e=0;e>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f>24,(d&16711680)>>16,(d&65280)>>8,d&255]))));d+=1}return b}RSAKey.prototype.signPSS=function(e,a,d){var c=function(f){return KJUR.crypto.Util.hashHex(f,a)};var b=c(rstrtohex(e));if(d===undefined){d=-1}return this.signWithMessageHashPSS(b,a,d)};RSAKey.prototype.signWithMessageHashPSS=function(l,a,k){var b=hextorstr(l);var g=b.length;var m=this.n.bitLength()-1;var c=Math.ceil(m/8);var d;var o=function(i){return KJUR.crypto.Util.hashHex(i,a)};if(k===-1||k===undefined){k=g}else{if(k===-2){k=c-g-2}else{if(k<-2){throw new Error("invalid salt length")}}}if(c<(g+k+2)){throw new Error("data too long")}var f="";if(k>0){f=new Array(k);new SecureRandom().nextBytes(f);f=String.fromCharCode.apply(String,f)}var n=hextorstr(o(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+b+f)));var j=[];for(d=0;d>(8*c-m))&255;q[0]&=~p;for(d=0;dk){return false}var j=this.doPublic(b);var i=j.toString(16);if(i.length+3!=k/4){return false}var e=i.replace(/^1f+00/,"");var g=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(g.length==0){return false}var d=g[0];var h=g[1];var a=function(m){return KJUR.crypto.Util.hashString(m,d)};var c=a(f);return(h==c)};RSAKey.prototype.verifyWithMessageHash=function(e,a){if(a.length!=Math.ceil(this.n.bitLength()/4)){return false}var b=parseBigInt(a,16);if(b.bitLength()>this.n.bitLength()){return 0}var h=this.doPublic(b);var g=h.toString(16).replace(/^1f+00/,"");var c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(g);if(c.length==0){return false}var d=c[0];var f=c[1];return(f==e)};RSAKey.prototype.verifyPSS=function(c,b,a,f){var e=function(g){return KJUR.crypto.Util.hashHex(g,a)};var d=e(rstrtohex(c));if(f===undefined){f=-1}return this.verifyWithMessageHashPSS(d,b,a,f)};RSAKey.prototype.verifyWithMessageHashPSS=function(f,s,l,c){if(s.length!=Math.ceil(this.n.bitLength()/4)){return false}var k=new BigInteger(s,16);var r=function(i){return KJUR.crypto.Util.hashHex(i,l)};var j=hextorstr(f);var h=j.length;var g=this.n.bitLength()-1;var m=Math.ceil(g/8);var q;if(c===-1||c===undefined){c=h}else{if(c===-2){c=m-h-2}else{if(c<-2){throw new Error("invalid salt length")}}}if(m<(h+c+2)){throw new Error("data too long")}var a=this.doPublic(k).toByteArray();for(q=0;q>(8*m-g))&255;if((d.charCodeAt(0)&p)!==0){throw new Error("bits beyond keysize not zero")}var n=pss_mgf1_str(e,d.length,r);var o=[];for(q=0;q>6);var i=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16))}var j=224|((h&240)>>4);var i=128|((h&15)<<2)|((a&192)>>6);var g=128|(a&63);return hextoutf8(j.toString(16)+i.toString(16)+g.toString(16))}var c=d.match(/.{4}/g);var b=c.map(e);return b.join("")}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;b0){o=o+"."+k.join(".")}return o}catch(j){return null}}function inttohex(b){var a=new BigInteger(String(b),10);return twoscompl(a)}function twoscompl(b){var g=b.toString(16);if(g.substr(0,1)!="-"){if(g.length%2==1){g="0"+g}else{if(!g.match(/^[0-7]/)){g="00"+g}}return g}var a=g.substr(1);var f=a.length;if(f%2==1){f+=1}else{if(!g.match(/^[0-7]/)){f+=2}}var j="";for(var e=0;e=b){return c}return new Array(b-c.length+1).join(a)+c};function bitstrtoint(e){if(e.length%2!=0){return -1}e=e.toLowerCase();if(e.match(/^[0-9a-f]+$/)==null){return -1}try{var a=e.substr(0,2);if(a=="00"){return parseInt(e.substr(2),16)}var b=parseInt(a,16);if(b>7){return -1}var g=e.substr(2);var d=parseInt(g,16).toString(2);if(d=="0"){d="00000000"}d=d.slice(0,0-b);var f=parseInt(d,2);if(f==NaN){return -1}return f}catch(c){return -1}}function inttobitstr(e){if(typeof e!="number"){return null}if(e<0){return null}var c=Number(e).toString(2);var b=8-c.length%8;if(b==8){b=0}c=c+strpad("",b,"0");var d=parseInt(c,2).toString(16);if(d.length%2==1){d="0"+d}var a="0"+b;return a+d}function bitstrtobinstr(g){if(typeof g!="string"){return null}if(g.length%2!=0){return null}if(!g.match(/^[0-9a-f]+$/)){return null}try{var c=parseInt(g.substr(0,2),16);if(c<0||7=0;a--){c+=b[a]}return c}function aryval(e,c,d){if(typeof e!="object"){return undefined}var c=String(c).split(".");for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;fd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f=0;--u){v=v.twice2D();v.z=f.ONE;if(t.testBit(u)){if(s.testBit(u)){v=v.add2D(y)}else{v=v.add2D(x)}}else{if(s.testBit(u)){v=v.add2D(w)}}}return v}this.getBigRandom=function(r){return new f(r.bitLength(),a).mod(r.subtract(f.ONE)).add(f.ONE)};this.setNamedCurve=function(r){this.ecparams=c.getByName(r);this.prvKeyHex=null;this.pubKeyHex=null;this.curveName=r};this.setPrivateKeyHex=function(r){this.isPrivate=true;this.prvKeyHex=r};this.setPublicKeyHex=function(r){this.isPublic=true;this.pubKeyHex=r};this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if(t.substr(0,2)!=="04"){throw"this method supports uncompressed format(04) only"}var s=this.ecparams.keycharlen;if(t.length!==2+s*2){throw"malformed public key hex length"}var r={};r.x=t.substr(2,s);r.y=t.substr(2+s);return r};this.getShortNISTPCurveName=function(){var r=this.curveName;if(r==="secp256r1"||r==="NIST P-256"||r==="P-256"||r==="prime256v1"){return"P-256"}if(r==="secp384r1"||r==="NIST P-384"||r==="P-384"){return"P-384"}if(r==="secp521r1"||r==="NIST P-521"||r==="P-521"){return"P-521"}return null};this.generateKeyPairHex=function(){var s=this.ecparams.n;var u=this.getBigRandom(s);var r=this.ecparams.keycharlen;var t=("0000000000"+u.toString(16)).slice(-r);this.setPrivateKeyHex(t);var v=this.generatePublicKeyHex();return{ecprvhex:t,ecpubhex:v}};this.generatePublicKeyHex=function(){var u=new f(this.prvKeyHex,16);var w=this.ecparams.G.multiply(u);var t=w.getX().toBigInteger();var s=w.getY().toBigInteger();var r=this.ecparams.keycharlen;var y=("0000000000"+t.toString(16)).slice(-r);var v=("0000000000"+s.toString(16)).slice(-r);var x="04"+y+v;this.setPublicKeyHex(x);return x};this.signWithMessageHash=function(r){return this.signHex(r,this.prvKeyHex)};this.signHex=function(x,u){var A=new f(u,16);var v=this.ecparams.n;var z=new f(x.substring(0,this.ecparams.keycharlen),16);do{var w=this.getBigRandom(v);var B=this.ecparams.G;var y=B.multiply(w);var t=y.getX().toBigInteger().mod(v)}while(t.compareTo(f.ZERO)<=0);var C=w.modInverse(v).multiply(z.add(A.multiply(t))).mod(v);return m.biRSSigToASN1Sig(t,C)};this.sign=function(w,B){var z=B;var u=this.ecparams.n;var y=f.fromByteArrayUnsigned(w);do{var v=this.getBigRandom(u);var A=this.ecparams.G;var x=A.multiply(v);var t=x.getX().toBigInteger().mod(u)}while(t.compareTo(BigInteger.ZERO)<=0);var C=v.modInverse(u).multiply(y.add(z.multiply(t))).mod(u);return this.serializeSig(t,C)};this.verifyWithMessageHash=function(s,r){return this.verifyHex(s,r,this.pubKeyHex)};this.verifyHex=function(v,y,u){try{var t,B;var w=m.parseSigHex(y);t=w.r;B=w.s;var x=h.decodeFromHex(this.ecparams.curve,u);var z=new f(v.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(z,t,B,x)}catch(A){return false}};this.verify=function(z,A,u){var w,t;if(Bitcoin.Util.isArray(A)){var y=this.parseSig(A);w=y.r;t=y.s}else{if("object"===typeof A&&A.r&&A.s){w=A.r;t=A.s}else{throw"Invalid value for signature"}}var v;if(u instanceof ECPointFp){v=u}else{if(Bitcoin.Util.isArray(u)){v=h.decodeFrom(this.ecparams.curve,u)}else{throw"Invalid format for pubkey value, must be byte array or ECPointFp"}}var x=f.fromByteArrayUnsigned(z);return this.verifyRaw(x,w,t,v)};this.verifyRaw=function(z,t,E,y){var x=this.ecparams.n;var D=this.ecparams.G;if(t.compareTo(f.ONE)<0||t.compareTo(x)>=0){return false}if(E.compareTo(f.ONE)<0||E.compareTo(x)>=0){return false}var A=E.modInverse(x);var w=z.multiply(A).mod(x);var u=t.multiply(A).mod(x);var B=D.multiply(w).add(y.multiply(u));var C=B.getX().toBigInteger().mod(x);return C.equals(t)};this.serializeSig=function(v,u){var w=v.toByteArraySigned();var t=u.toByteArraySigned();var x=[];x.push(2);x.push(w.length);x=x.concat(w);x.push(2);x.push(t.length);x=x.concat(t);x.unshift(x.length);x.unshift(48);return x};this.parseSig=function(y){var x;if(y[0]!=48){throw new Error("Signature not a valid DERSequence")}x=2;if(y[x]!=2){throw new Error("First element in signature must be a DERInteger")}var w=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];if(y[x]!=2){throw new Error("Second element in signature must be a DERInteger")}var t=y.slice(x+2,x+2+y[x+1]);x+=2+y[x+1];var v=f.fromByteArrayUnsigned(w);var u=f.fromByteArrayUnsigned(t);return{r:v,s:u}};this.parseSigCompact=function(w){if(w.length!==65){throw"Signature has the wrong length"}var t=w[0]-27;if(t<0||t>7){throw"Invalid signature type"}var x=this.ecparams.n;var v=f.fromByteArrayUnsigned(w.slice(1,33)).mod(x);var u=f.fromByteArrayUnsigned(w.slice(33,65)).mod(x);return{r:v,s:u,i:t}};this.readPKCS5PrvKeyHex=function(u){if(k(u)===false){throw new Error("not ASN.1 hex string")}var r,t,v;try{r=n(u,0,["[0]",0],"06");t=n(u,0,[1],"04");try{v=n(u,0,["[1]",0],"03")}catch(s){}}catch(s){throw new Error("malformed PKCS#1/5 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v);this.setPrivateKeyHex(t);this.isPublic=false};this.readPKCS8PrvKeyHex=function(v){if(k(v)===false){throw new j("not ASN.1 hex string")}var t,r,u,w;try{t=n(v,0,[1,0],"06");r=n(v,0,[1,1],"06");u=n(v,0,[2,0,1],"04");try{w=n(v,0,[2,0,"[1]",0],"03")}catch(s){}}catch(s){throw new j("malformed PKCS#8 plain ECC private key")}this.curveName=d(r);if(this.curveName===undefined){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(w);this.setPrivateKeyHex(u);this.isPublic=false};this.readPKCS8PubKeyHex=function(u){if(k(u)===false){throw new j("not ASN.1 hex string")}var t,r,v;try{t=n(u,0,[0,0],"06");r=n(u,0,[0,1],"06");v=n(u,0,[1],"03")}catch(s){throw new j("malformed PKCS#8 ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(v)};this.readCertPubKeyHex=function(t,v){if(k(t)===false){throw new j("not ASN.1 hex string")}var r,u;try{r=n(t,0,[0,5,0,1],"06");u=n(t,0,[0,5,1],"03")}catch(s){throw new j("malformed X.509 certificate ECC public key")}this.curveName=d(r);if(this.curveName===null){throw new j("unsupported curve name")}this.setNamedCurve(this.curveName);this.setPublicKeyHex(u)};if(e!==undefined){if(e.curve!==undefined){this.curveName=e.curve}}if(this.curveName===undefined){this.curveName=g}this.setNamedCurve(this.curveName);if(e!==undefined){if(e.prv!==undefined){this.setPrivateKeyHex(e.prv)}if(e.pub!==undefined){this.setPublicKeyHex(e.pub)}}};KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a);var d=new BigInteger(b.r,16);var c=new BigInteger(b.s,16);return{r:d,s:c}};KJUR.crypto.ECDSA.parseSigHexInHexRS=function(f){var j=ASN1HEX,i=j.getChildIdx,g=j.getV;j.checkStrictDER(f,0);if(f.substr(0,2)!="30"){throw new Error("signature is not a ASN.1 sequence")}var h=i(f,0);if(h.length!=2){throw new Error("signature shall have two elements")}var e=h[0];var d=h[1];if(f.substr(e,2)!="02"){throw new Error("1st item not ASN.1 integer")}if(f.substr(d,2)!="02"){throw new Error("2nd item not ASN.1 integer")}var c=g(f,e);var b=g(f,d);return{r:c,s:b}};KJUR.crypto.ECDSA.asn1SigToConcatSig=function(d){var e=KJUR.crypto.ECDSA.parseSigHexInHexRS(d);var b=e.r;var a=e.s;if(b.length>=130&&b.length<=134){if(b.length%2!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%2!=0){throw Error("unknown ECDSA sig s length error")}if(b.substr(0,2)=="00"){b=b.substr(2)}if(a.substr(0,2)=="00"){a=a.substr(2)}var c=Math.max(b.length,a.length);b=("000000"+b).slice(-c);a=("000000"+a).slice(-c);return b+a}if(b.substr(0,2)=="00"&&(b.length%32)==2){b=b.substr(2)}if(a.substr(0,2)=="00"&&(a.length%32)==2){a=a.substr(2)}if((b.length%32)==30){b="00"+b}if((a.length%32)==30){a="00"+a}if(b.length%32!=0){throw Error("unknown ECDSA sig r length error")}if(a.length%32!=0){throw Error("unknown ECDSA sig s length error")}return b+a};KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if(a.length%4!=0){throw Error("unknown ECDSA concatinated r-s sig length error")}var c=a.substr(0,a.length/2);var b=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(c,b)};KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(b,a){var d=new BigInteger(b,16);var c=new BigInteger(a,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(d,c)};KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(f,d){var c=KJUR.asn1;var b=new c.DERInteger({bigint:f});var a=new c.DERInteger({bigint:d});var e=new c.DERSequence({array:[b,a]});return e.tohex()};KJUR.crypto.ECDSA.getName=function(a){if(a==="2b8104001f"){return"secp192k1"}if(a==="2a8648ce3d030107"){return"secp256r1"}if(a==="2b8104000a"){return"secp256k1"}if(a==="2b81040021"){return"secp224r1"}if(a==="2b81040022"){return"secp384r1"}if(a==="2b81040023"){return"secp521r1"}if("|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(a)!==-1){return"secp256r1"}if("|secp256k1|".indexOf(a)!==-1){return"secp256k1"}if("|secp224r1|NIST P-224|P-224|".indexOf(a)!==-1){return"secp224r1"}if("|secp384r1|NIST P-384|P-384|".indexOf(a)!==-1){return"secp384r1"}if("|secp521r1|NIST P-521|P-521|".indexOf(a)!==-1){return"secp521r1"}return null}; if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.crypto=="undefined"||!KJUR.crypto){KJUR.crypto={}}KJUR.crypto.ECParameterDB=new function(){var b={};var c={};function a(d){return new BigInteger(d,16)}this.getByName=function(e){var d=e;if(typeof c[d]!="undefined"){d=c[e]}if(typeof b[d]!="undefined"){return b[d]}throw"unregistered EC curve name: "+d};this.regist=function(A,l,o,g,m,e,j,f,k,u,d,x){b[A]={};var s=a(o);var z=a(g);var y=a(m);var t=a(e);var w=a(j);var r=new ECCurveFp(s,z,y);var q=r.decodePointHex("04"+f+k);b[A]["name"]=A;b[A]["keylen"]=l;b[A]["keycharlen"]=Math.ceil(l/8)*2;b[A]["curve"]=r;b[A]["G"]=q;b[A]["n"]=t;b[A]["h"]=w;b[A]["oid"]=d;b[A]["info"]=x;for(var v=0;v1){l=new BigInteger(n,16)}else{l=null}m=new BigInteger(o,16);this.setPrivate(h,f,j,l,m)};this.setPublic=function(i,h,f,j){this.isPublic=true;this.p=i;this.q=h;this.g=f;this.y=j;this.x=null};this.setPublicHex=function(k,j,i,l){var g,f,m,h;g=new BigInteger(k,16);f=new BigInteger(j,16);m=new BigInteger(i,16);h=new BigInteger(l,16);this.setPublic(g,f,m,h)};this.signWithMessageHash=function(j){var i=this.p;var h=this.q;var m=this.g;var o=this.y;var t=this.x;var l=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),h.subtract(BigInteger.ONE));var u=j.substr(0,h.bitLength()/4);var n=new BigInteger(u,16);var f=(m.modPow(l,i)).mod(h);var w=(l.modInverse(h).multiply(n.add(t.multiply(f)))).mod(h);var v=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:f}},{"int":{bigint:w}}]});return v};this.verifyWithMessageHash=function(m,l){var j=this.p;var h=this.q;var o=this.g;var u=this.y;var n=this.parseASN1Signature(l);var f=n[0];var C=n[1];var B=m.substr(0,h.bitLength()/4);var t=new BigInteger(B,16);if(BigInteger.ZERO.compareTo(f)>0||f.compareTo(h)>0){throw"invalid DSA signature"}if(BigInteger.ZERO.compareTo(C)>=0||C.compareTo(h)>0){throw"invalid DSA signature"}var x=C.modInverse(h);var k=t.multiply(x).mod(h);var i=f.multiply(x).mod(h);var A=o.modPow(k,j).multiply(u.modPow(i,j)).mod(j).mod(h);return A.compareTo(f)==0};this.parseASN1Signature=function(f){try{var i=new c(d(f,0,[0],"02"),16);var h=new c(d(f,0,[1],"02"),16);return[i,h]}catch(g){throw new Error("malformed ASN.1 DSA signature")}};this.readPKCS5PrvKeyHex=function(j){var k,i,g,l,m;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1],"02");i=d(j,0,[2],"02");g=d(j,0,[3],"02");l=d(j,0,[4],"02");m=d(j,0,[5],"02")}catch(f){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(k,i,g,l,m)};this.readPKCS8PrvKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1,1,0],"02");i=d(j,0,[1,1,1],"02");g=d(j,0,[1,1,2],"02");l=d(j,0,[2,0],"02")}catch(f){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(k,i,g,null,l)};this.readPKCS8PubKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,1,0],"02");i=d(j,0,[0,1,1],"02");g=d(j,0,[0,1,2],"02");l=d(j,0,[1,0],"02")}catch(f){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(k,i,g,l)};this.readCertPubKeyHex=function(j,m){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,5,0,1,0],"02");i=d(j,0,[0,5,0,1,1],"02");g=d(j,0,[0,5,0,1,2],"02");l=d(j,0,[0,5,1,0],"02")}catch(f){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(k,i,g,l)}}; diff --git a/npm/package.json b/npm/package.json index d7790f9d..50c3a21c 100755 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "jsrsasign", - "version": "11.0.0", + "version": "11.1.0", "description": "opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK).", "main": "lib/jsrsasign.js", "scripts": { diff --git a/npm/test/t_keyutil_getpem.js b/npm/test/t_keyutil_getpem.js new file mode 100644 index 00000000..01cce7c9 --- /dev/null +++ b/npm/test/t_keyutil_getpem.js @@ -0,0 +1,32 @@ +const assert = require('assert'); +const rs = require('../lib/jsrsasign.js'); + +// RFC 9500 RSA1024 TEST PRIVATE KEY +let P5P = `-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCw0YNSqI9T1VFvRsIOejZ9feiKz1SgGfbe9Xq5tEzt2yJCsbyg ++xtcuCswNhdqY5A1ZN7G60HbL4/Hh/TlLhFJ4zNHVylz9mDDx3yp4IIcK2lb566d +fTD0B5EQ9Iqub4twLUdLKQCBfyhmJJvsEqKxm4J4QWgI+Brh/Pm3d4piPwIDAQAB +AoGASC6fj6TkLfMNdYHLQqG9kOlPfys4fstarpZD7X+fUBJ/H/7y5DzeZLGCYAIU ++QeAHWv6TfZIQjReW7Qy00RFJdgwFlTFRCsKXhG5x+IB+jL0Grr08KbgPPDgy4Jm +xirRHZVtU8lGbkiZX+omDIU28EHLNWL6rFEcTWao/tERspECQQDp2G5Nw0qYWn7H +Wm9Up1zkUTnkUkCzhqtxHbeRvNmHGKE7ryGMJEk2RmgHVstQpsvuFY4lIUSZEjAc +DUFJERhFAkEAwZH6O1ULORp8sHKDdidyleYcZU8L7y9Y3OXJYqELfddfBgFUZeVQ +duRmJj7ryu0g0uurOTE+i8VnMg/ostxiswJBAOc64Dd8uLJWKa6uug+XPr91oi0n +OFtM+xHrNK2jc+WmcSg3UJDnAI3uqMc5B+pERLq0Dc6hStehqHjUko3RnZECQEGZ +eRYWciE+Cre5dzfZkomeXE0xBrhecV0bOq6EKWLSVE+yr6mAl05ThRK9DCfPSOpy +F6rgN3QiyCA9J/1FluUCQQC5nX+PTU1FXx+6Ri2ZCi6EjEKMHr7gHcABhMinZYOt +N59pra9UdVQw9jxCU9G7eMyb0jJkNACAuEwakX3gi27b +-----END RSA PRIVATE KEY-----`; + +let prvobj = rs.KEYUTIL.getKey(P5P); + +describe("KEYUTIL", function() { + describe("getPEM", function() { + it('encrypted private key PKCS8PRV', function() { + let head = "-----BEGIN ENCRYPTED PRIVATE KEY-----"; + let prvencpem = rs.KEYUTIL.getPEM(prvobj, "PKCS8PRV", "passwd"); + assert.equal(head, prvencpem.substr(0, head.length)); + }); + }); +}); + diff --git a/src/crypto-1.1.js b/src/crypto-1.1.js index 8566fd76..5c34fd27 100644 --- a/src/crypto-1.1.js +++ b/src/crypto-1.1.js @@ -1,9 +1,9 @@ -/* crypto-2.0.0.js (c) 2013-2024 Kenji Urushima | kjur.github.io/jsrsasign/license +/* crypto-2.1.0.js (c) 2013-2024 Kenji Urushima | kjur.github.io/jsrsasign/license */ /* * crypto.js - Cryptographic Algorithm Provider class * - * Copyright (c) 2013-2021 Kenji Urushima (kenji.urushima@gmail.com) + * Copyright (c) 2013-2024 Kenji Urushima (kenji.urushima@gmail.com) * * This software is licensed under the terms of the MIT License. * https://kjur.github.io/jsrsasign/license @@ -16,7 +16,7 @@ * @fileOverview * @name crypto-1.1.js * @author Kenji Urushima kenji.urushima@gmail.com - * @version jsrsasign 11.0.0 crypto 2.0.0 (2024-Jan-16) + * @version jsrsasign 11.1.0 crypto 2.1.0 (2024-Feb-01) * @since jsrsasign 2.2 * @license MIT License */ @@ -1373,7 +1373,7 @@ KJUR.crypto.Signature = function(params) { }; // ====== Cipher class ============================================================ -/* +/** * Cipher class to encrypt and decrypt data
    * @name KJUR.crypto.Cipher * @class Cipher class to encrypt and decrypt data
    @@ -1382,49 +1382,41 @@ KJUR.crypto.Signature = function(params) { * @description * Here is supported canonicalized cipher algorithm names and its standard names: *
      - *
    • RSA - RSA/ECB/PKCS1Padding (default for RSAKey)
    • - *
    • RSAOAEP - RSA/ECB/OAEPWithSHA-1AndMGF1Padding
    • - *
    • RSAOAEP224 - RSA/ECB/OAEPWithSHA-224AndMGF1Padding(*)
    • - *
    • RSAOAEP256 - RSA/ECB/OAEPWithSHA-256AndMGF1Padding
    • - *
    • RSAOAEP384 - RSA/ECB/OAEPWithSHA-384AndMGF1Padding(*)
    • - *
    • RSAOAEP512 - RSA/ECB/OAEPWithSHA-512AndMGF1Padding(*)
    • + *
    • aes256-CBC
    • + *
    • aes128-CBC
    • + *
    • des-EDE3-CBC
    • *
    - * NOTE: (*) is not supported in Java JCE.
    - * Currently this class supports only RSA encryption and decryption - * based on RSAES-OAEP and RSAES-PKCS1-v1_5 scheme. - * However it is planning to implement also symmetric ciphers near in the future */ -/* + * NOTE: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed + * because of Marvin attack vulnerability. + */ KJUR.crypto.Cipher = function(params) { }; - */ -/* + +/** * encrypt raw string by specified key and algorithm
    * @name encrypt * @memberOf KJUR.crypto.Cipher * @function - * @param {String} s input string to encrypt - * @param {Object} keyObj RSAKey object or hexadecimal string of symmetric cipher key - * @param {String} algName short/long algorithm name for encryption/decryption (OPTION) + * @param {string} s input string to encrypt + * @param {string} hexadecimal string of symmetric cipher key + * @param {string} algName short/long algorithm name for encryption/decryption (OPTION) * @param {object} param parameters for synchronous cipher such as initial vector (OPTION) - * @return {String} hexadecimal encrypted string + * @return {string} hexadecimal encrypted string * @since jsrsasign 6.2.0 crypto 1.1.10 * * @description * This static method encrypts raw string with specified key and algorithm. *
    * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBC) is also supported. + * NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed + * because of Marvin attack vulnerability. * * @example - * // asynchronous cipher - * KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj) → "1abc2d..." - * KJUR.crypto.Cipher.encrypt("aaa", pubRSAKeyObj, "RSAOAEP") → "23ab02..." - * // synchronous cipher * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) * KJUR.crypto.Cipher.encrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) * KJUR.crypto.Cipher.encrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) * KJUR.crypto.Cipher.encrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) */ -/* KJUR.crypto.Cipher.encrypt = function(s, keyObj, algName, param) { if (aryval(param, "enclag") != undefined) algName = param.encalg; @@ -1445,49 +1437,36 @@ KJUR.crypto.Cipher.encrypt = function(s, keyObj, algName, param) { throw new Error("unsupported algorithm: " + algName); } return wEnc + ""; - } else if (keyObj instanceof RSAKey && keyObj.isPublic) { - var algName2 = KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName); - if (algName2 === "RSA") return keyObj.encrypt(s); - if (algName2 === "RSAOAEP") return keyObj.encryptOAEP(s, "sha1"); - - var a = algName2.match(/^RSAOAEP(\d+)$/); - if (a !== null) return keyObj.encryptOAEP(s, "sha" + a[1]); - - throw "Cipher.encrypt: unsupported algorithm for RSAKey: " + algName; } else { - throw "Cipher.encrypt: unsupported key or algorithm"; + throw new Error("Cipher.encrypt: unsupported key or algorithm"); } }; - */ -/* +/** * decrypt encrypted hexadecimal string with specified key and algorithm
    * @name decrypt * @memberOf KJUR.crypto.Cipher * @function * @param {string} hex hexadecimal string of encrypted message - * @param {object} keyObj RSAKey object or hexadecimal string of symmetric cipher key + * @param {object} hexadecimal string of symmetric cipher key * @param {string} algName short/long algorithm name for encryption/decryption (OPTION) * @param {object} param parameters for synchronous cipher such as initial vector (OPTION) - * @return {String} decrypted raw string + * @return {string} decrypted raw string * @since jsrsasign 6.2.0 crypto 1.1.10 * * @description * This static method decrypts encrypted hexadecimal string with specified key and algorithm. *
    * NOTE: From jsrsasign 10.9.0, asymmetric cipher ({des-EDE3,aes{128,256}}-CBCis also supported. + * NOTE2: From jsrsasign 11.0.0, RSA and RSAOAEP encryption/decryption support is removed + * because of Marvin attack vulnerability. * * @example - * // asynchronous cipher - * KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj) → "1abc2d..." - * KJUR.crypto.Cipher.decrypt("aaa", prvRSAKeyObj, "RSAOAEP) → "23ab02..." - * // synchronous cipher * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", "aes256-CBC", { iv: "1b3c..." }) * KJUR.crypto.Cipher.decrypt("12abcd...", "5a7d...", any, { encalg: "aes128-CBC", iv: "1b3c..." }) * KJUR.crypto.Cipher.decrypt("12abcd...", any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41..." }) * KJUR.crypto.Cipher.decrypt(any, any, any, { encalg: "des-EDE3-CBC", iv: "1b3c...", key: "3d41...", enc: "12abcd..." }) */ -/* KJUR.crypto.Cipher.decrypt = function(hex, keyObj, algName, param) { if (aryval(param, "enclag") != undefined) algName = param.encalg; @@ -1508,20 +1487,10 @@ KJUR.crypto.Cipher.decrypt = function(hex, keyObj, algName, param) { throw new Error("unsupported algorithm: " + algName); } return CryptoJS.enc.Hex.stringify(wDec); - } else if (keyObj instanceof RSAKey && keyObj.isPrivate) { - var algName2 = KJUR.crypto.Cipher.getAlgByKeyAndName(keyObj, algName); - if (algName2 === "RSA") return keyObj.decrypt(hex); - if (algName2 === "RSAOAEP") return keyObj.decryptOAEP(hex, "sha1"); - - var a = algName2.match(/^RSAOAEP(\d+)$/); - if (a !== null) return keyObj.decryptOAEP(hex, "sha" + a[1]); - - throw "Cipher.decrypt: unsupported algorithm for RSAKey: " + algName; } else { - throw "Cipher.decrypt: unsupported key or algorithm"; + throw new Error("Cipher.decrypt: unsupported key or algorithm"); } }; - */ /* * get canonicalized encrypt/decrypt algorithm name by key and short/long algorithm name
    diff --git a/test/qunit-do-crypto-cipher.html b/test/qunit-do-crypto-cipher.html index 7ca8654c..c41cd259 100644 --- a/test/qunit-do-crypto-cipher.html +++ b/test/qunit-do-crypto-cipher.html @@ -87,7 +87,7 @@ // aaa RSAOAEP encrypted by z4prv (b000) var AAAOAEPENCZ4 = "6249fb5dbcd9bdfc8f8b92878f9c2ea10efad01341ab91475cf0245cb8b83e5cd222f3568e232a983590e8193718d004c8d7d2b4fc6c631f6b05d2590439025eba83ce50a7eaa2a39c91eabe70900017d2e9adb72633b285db6b2953b0da121719f1f00d4bab2c4be655aa510eebc9a2b2a084fa7e9859093d9ae9a99d4d48953b7fa871b80e617b237e267563fb7b6ab4562cdccb12e8146a547d4ca80719059ea7aad18e36a9741141d86ba02afebaaf17aa6878a27b0a7683804f10211c656da9d7e74b44630a5cc36ab1aa838d8af0493d1e4168b10b2380e165de6744e317274f64f3aff8b285be56e5f7049eafc2ea58a58cdb0e3da8e6427c45c1e2b5"; - +/* test("KJUR.crypto.Cipher.getAlgByKeyAndName", function() { var CY = KJUR.crypto.Cipher; var kp = KEYUTIL.generateKeypair("RSA", 1024); @@ -101,14 +101,16 @@ equal(CY.getAlgByKeyAndName(prv, "RSAOAEP384"), "RSAOAEP384", "prv RSAKey, RSAOAEP384"); equal(CY.getAlgByKeyAndName(prv, "RSAOAEP512"), "RSAOAEP512", "prv RSAKey, RSAOAEP512"); }); - + */ +/* test("RSAKey.oaep_pad/oaep_unpad", function() { var bi1 = oaep_pad("aaa", 128); var h1 = bi1.toString(16); var bi2 = new BigInteger(h1, 16); equal(oaep_unpad(bi2, 128), "aaa", "aaa"); }); - + */ +/* test("RSAKey.decryptOAEP/encryptOAEP", function() { var kp = KEYUTIL.generateKeypair("RSA", 1024); var pub = kp.pubKeyObj; @@ -116,7 +118,8 @@ equal(prv.decryptOAEP(pub.encryptOAEP("aaa")), "aaa", "aaa"); equal(prv.decryptOAEP(pub.encryptOAEP("aaa", "sha256"), "sha256"), "aaa", "aaa"); }); - + */ +/* test("KJUR.crypto.Cipher.encrypt/decrypt", function() { var CY = KJUR.crypto.Cipher; var kp = KEYUTIL.generateKeypair("RSA", 1024); @@ -128,7 +131,8 @@ equal(CY.decrypt(CY.encrypt("aaa", pub, "RSAOAEP"), prv, "RSAOAEP"), "aaa", "aaa"); equal(CY.decrypt(CY.encrypt("aaa", pub, "RSAOAEP256"), prv, "RSAOAEP256"), "aaa", "aaa"); }); - + */ +/* test("KJUR.crypto.Cipher.encrypt/decrypt RSA maleability test", function() { var prv = KEYUTIL.getKey(Z4PRVPEM); @@ -141,7 +145,8 @@ "raise error for wrong ctext length" ); }); - + */ +/* test("KJUR.crypto.Cipher.encrypt/decrypt RSAOAEP maleability test", function() { var prv = KEYUTIL.getKey(Z4PRVPEM); @@ -154,7 +159,7 @@ "raise error for wrong ctext length" ); }); - + */ test("Cipher.encrypt/decrypt des-EDE3-CBC", function() { var _decrypt = KJUR.crypto.Cipher.decrypt; var _encrypt = KJUR.crypto.Cipher.encrypt;