From 7d802293381e09ecf8edfc7d95a5359287d03c9e Mon Sep 17 00:00:00 2001 From: Kenji Urushima Date: Wed, 14 Oct 2020 02:16:15 +0900 Subject: [PATCH] 10.0.1 release --- ChangeLog.txt | 14 + README.md | 3 +- api/files.html | 8 +- api/index.html | 8 + api/symbols/ASN1HEX.html | 2 + api/symbols/Base64x.html | 2 + api/symbols/KEYUTIL.html | 2 + api/symbols/KJUR.asn1.ASN1Object.html | 2 + api/symbols/KJUR.asn1.ASN1Util.html | 2 + api/symbols/KJUR.asn1.DERAbstractString.html | 2 + .../KJUR.asn1.DERAbstractStructured.html | 2 + api/symbols/KJUR.asn1.DERAbstractTime.html | 2 + api/symbols/KJUR.asn1.DERBMPString.html | 2 + api/symbols/KJUR.asn1.DERBitString.html | 2 + api/symbols/KJUR.asn1.DERBoolean.html | 12 +- api/symbols/KJUR.asn1.DEREnumerated.html | 2 + api/symbols/KJUR.asn1.DERGeneralizedTime.html | 2 + api/symbols/KJUR.asn1.DERIA5String.html | 2 + api/symbols/KJUR.asn1.DERInteger.html | 2 + api/symbols/KJUR.asn1.DERNull.html | 2 + api/symbols/KJUR.asn1.DERNumericString.html | 2 + .../KJUR.asn1.DERObjectIdentifier.html | 2 + api/symbols/KJUR.asn1.DEROctetString.html | 2 + api/symbols/KJUR.asn1.DERPrintableString.html | 2 + api/symbols/KJUR.asn1.DERSequence.html | 2 + api/symbols/KJUR.asn1.DERSet.html | 2 + api/symbols/KJUR.asn1.DERTaggedObject.html | 2 + api/symbols/KJUR.asn1.DERTeletexString.html | 2 + api/symbols/KJUR.asn1.DERUTCTime.html | 2 + api/symbols/KJUR.asn1.DERUTF8String.html | 2 + api/symbols/KJUR.asn1.DERVisibleString.html | 2 + api/symbols/KJUR.asn1.cades.CAdESUtil.html | 2 + ...UR.asn1.cades.CompleteCertificateRefs.html | 2 + api/symbols/KJUR.asn1.cades.OtherCertID.html | 2 + api/symbols/KJUR.asn1.cades.OtherHash.html | 2 + .../KJUR.asn1.cades.OtherHashAlgAndValue.html | 2 + .../KJUR.asn1.cades.OtherHashValue.html | 2 + .../KJUR.asn1.cades.SignaturePolicyId.html | 2 + ....asn1.cades.SignaturePolicyIdentifier.html | 2 + .../KJUR.asn1.cades.SignatureTimeStamp.html | 2 + api/symbols/KJUR.asn1.cades.html | 2 + api/symbols/KJUR.asn1.cms.Attribute.html | 2 + api/symbols/KJUR.asn1.cms.AttributeList.html | 2 + api/symbols/KJUR.asn1.cms.CMSUtil.html | 2 + api/symbols/KJUR.asn1.cms.CertificateSet.html | 2 + api/symbols/KJUR.asn1.cms.ContentInfo.html | 2 + api/symbols/KJUR.asn1.cms.ContentType.html | 2 + api/symbols/KJUR.asn1.cms.ESSCertID.html | 2 + api/symbols/KJUR.asn1.cms.ESSCertIDv2.html | 2 + ...KJUR.asn1.cms.EncapsulatedContentInfo.html | 2 + .../KJUR.asn1.cms.IssuerAndSerialNumber.html | 2 + api/symbols/KJUR.asn1.cms.IssuerSerial.html | 2 + api/symbols/KJUR.asn1.cms.MessageDigest.html | 2 + .../KJUR.asn1.cms.OtherRevocationFormat.html | 2 + .../KJUR.asn1.cms.RevocationInfoChoice.html | 2 + .../KJUR.asn1.cms.RevocationInfoChoices.html | 2 + api/symbols/KJUR.asn1.cms.SignedData.html | 2 + .../KJUR.asn1.cms.SignerIdentifier.html | 2 + api/symbols/KJUR.asn1.cms.SignerInfo.html | 2 + .../KJUR.asn1.cms.SigningCertificate.html | 2 + .../KJUR.asn1.cms.SigningCertificateV2.html | 2 + api/symbols/KJUR.asn1.cms.SigningTime.html | 2 + .../KJUR.asn1.cms.SubjectKeyIdentifier.html | 2 + api/symbols/KJUR.asn1.cms.html | 2 + api/symbols/KJUR.asn1.csr.CSRUtil.html | 2 + .../KJUR.asn1.csr.CertificationRequest.html | 2 + ...JUR.asn1.csr.CertificationRequestInfo.html | 2 + api/symbols/KJUR.asn1.csr.html | 2 + api/symbols/KJUR.asn1.html | 2 + .../KJUR.asn1.ocsp.BasicOCSPResponse.html | 2 + api/symbols/KJUR.asn1.ocsp.CertID.html | 2 + api/symbols/KJUR.asn1.ocsp.CertStatus.html | 2 + api/symbols/KJUR.asn1.ocsp.OCSPParser.html | 2 + api/symbols/KJUR.asn1.ocsp.OCSPRequest.html | 2 + api/symbols/KJUR.asn1.ocsp.OCSPResponse.html | 2 + api/symbols/KJUR.asn1.ocsp.OCSPUtil.html | 2 + api/symbols/KJUR.asn1.ocsp.Request.html | 2 + api/symbols/KJUR.asn1.ocsp.ResponderID.html | 2 + api/symbols/KJUR.asn1.ocsp.ResponseBytes.html | 2 + api/symbols/KJUR.asn1.ocsp.ResponseData.html | 2 + .../KJUR.asn1.ocsp.SingleResponse.html | 2 + .../KJUR.asn1.ocsp.SingleResponseList.html | 2 + api/symbols/KJUR.asn1.ocsp.TBSRequest.html | 2 + api/symbols/KJUR.asn1.ocsp.html | 2 + .../KJUR.asn1.tsp.AbstractTSAAdapter.html | 2 + api/symbols/KJUR.asn1.tsp.Accuracy.html | 2 + .../KJUR.asn1.tsp.FixedTSAAdapter.html | 2 + api/symbols/KJUR.asn1.tsp.MessageImprint.html | 2 + api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html | 2 + api/symbols/KJUR.asn1.tsp.PKIFreeText.html | 2 + api/symbols/KJUR.asn1.tsp.PKIStatus.html | 2 + api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html | 2 + .../KJUR.asn1.tsp.SimpleTSAAdapter.html | 2 + api/symbols/KJUR.asn1.tsp.TSPUtil.html | 2 + api/symbols/KJUR.asn1.tsp.TSTInfo.html | 2 + api/symbols/KJUR.asn1.tsp.TimeStampReq.html | 2 + api/symbols/KJUR.asn1.tsp.TimeStampResp.html | 2 + api/symbols/KJUR.asn1.tsp.TimeStampToken.html | 2 + api/symbols/KJUR.asn1.tsp.html | 2 + .../KJUR.asn1.x509.AlgorithmIdentifier.html | 2 + .../KJUR.asn1.x509.AttributeTypeAndValue.html | 2 + .../KJUR.asn1.x509.AuthorityInfoAccess.html | 2 + ...KJUR.asn1.x509.AuthorityKeyIdentifier.html | 2 + .../KJUR.asn1.x509.BasicConstraints.html | 2 + api/symbols/KJUR.asn1.x509.CRL.html | 2 + .../KJUR.asn1.x509.CRLDistributionPoints.html | 2 + api/symbols/KJUR.asn1.x509.CRLEntry.html | 2 + api/symbols/KJUR.asn1.x509.CRLNumber.html | 2 + api/symbols/KJUR.asn1.x509.CRLReason.html | 2 + api/symbols/KJUR.asn1.x509.Certificate.html | 2 + .../KJUR.asn1.x509.CertificatePolicies.html | 2 + api/symbols/KJUR.asn1.x509.DisplayText.html | 2 + .../KJUR.asn1.x509.DistributionPoint.html | 2 + .../KJUR.asn1.x509.DistributionPointName.html | 2 + api/symbols/KJUR.asn1.x509.ExtKeyUsage.html | 2 + api/symbols/KJUR.asn1.x509.Extension.html | 2 + api/symbols/KJUR.asn1.x509.Extensions.html | 2 + api/symbols/KJUR.asn1.x509.GeneralName.html | 2 + api/symbols/KJUR.asn1.x509.GeneralNames.html | 2 + api/symbols/KJUR.asn1.x509.IssuerAltName.html | 2 + api/symbols/KJUR.asn1.x509.KeyUsage.html | 2 + .../KJUR.asn1.x509.NoticeReference.html | 2 + api/symbols/KJUR.asn1.x509.OCSPNoCheck.html | 2 + api/symbols/KJUR.asn1.x509.OCSPNonce.html | 2 + api/symbols/KJUR.asn1.x509.OID.html | 2 + .../KJUR.asn1.x509.PolicyInformation.html | 2 + .../KJUR.asn1.x509.PolicyQualifierInfo.html | 2 + .../KJUR.asn1.x509.PrivateExtension.html | 2 + api/symbols/KJUR.asn1.x509.RDN.html | 2 + .../KJUR.asn1.x509.SubjectAltName.html | 2 + .../KJUR.asn1.x509.SubjectKeyIdentifier.html | 2 + .../KJUR.asn1.x509.SubjectPublicKeyInfo.html | 2 + api/symbols/KJUR.asn1.x509.TBSCertList.html | 2 + .../KJUR.asn1.x509.TBSCertificate.html | 2 + api/symbols/KJUR.asn1.x509.Time.html | 2 + api/symbols/KJUR.asn1.x509.UserNotice.html | 2 + api/symbols/KJUR.asn1.x509.X500Name.html | 2 + api/symbols/KJUR.asn1.x509.X509Util.html | 2 + api/symbols/KJUR.asn1.x509.html | 2 + api/symbols/KJUR.crypto.Cipher.html | 2 + api/symbols/KJUR.crypto.DSA.html | 2 + api/symbols/KJUR.crypto.ECDSA.html | 2 + api/symbols/KJUR.crypto.ECParameterDB.html | 2 + api/symbols/KJUR.crypto.Mac.html | 2 + api/symbols/KJUR.crypto.MessageDigest.html | 2 + api/symbols/KJUR.crypto.OID.html | 2 + api/symbols/KJUR.crypto.Signature.html | 2 + api/symbols/KJUR.crypto.Util.html | 2 + api/symbols/KJUR.crypto.html | 2 + api/symbols/KJUR.html | 2 + api/symbols/KJUR.jws.IntDate.html | 2 + api/symbols/KJUR.jws.JWS.html | 2 + api/symbols/KJUR.jws.JWSJS.html | 2 + api/symbols/KJUR.jws.html | 2 + api/symbols/KJUR.lang.String.html | 2 + api/symbols/RSAKey.html | 2 + api/symbols/X509.html | 101 + api/symbols/X509CRL.html | 2 + api/symbols/global__.html | 2 + api/symbols/src/asn1-1.0.js.html | 1984 ++--- api/symbols/src/asn1x509-1.0.js.html | 7376 +++++++++-------- api/symbols/src/x509-1.1.js.html | 1576 ++-- bower.json | 2 +- jsrsasign-all-min.js | 8 +- jsrsasign-jwths-min.js | 2 +- jsrsasign-rsa-min.js | 4 +- min/asn1-1.0.min.js | 2 +- min/asn1x509-1.0.min.js | 2 +- min/x509-1.1.min.js | 2 +- npm/README.md | 3 +- npm/lib/jsrsasign-all-min.js | 8 +- npm/lib/jsrsasign-jwths-min.js | 2 +- npm/lib/jsrsasign-rsa-min.js | 4 +- npm/lib/jsrsasign.js | 8 +- npm/package.json | 2 +- src/asn1-1.0.js | 18 +- src/asn1x509-1.0.js | 76 +- src/x509-1.1.js | 66 +- test/qunit-do-asn1.html | 5 +- test/qunit-do-asn1x509.html | 40 + 180 files changed, 6201 insertions(+), 5441 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index bc24f3c2..45d1cdf0 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,20 @@ ChangeLog for jsrsasign +AdobeTimeStamp X.509v3 certificate extension added +* Changes from 10.0.0 to 10.0.1 (2020-Oct-13) + - src/asn1x509.js + - AdobeTimeStamp class added + - add AdobeTimeStamp support in Extension class + - add "adobeTimeStamp" OID in OID class + - src/x509.js + - add getExtAdobeTimeStamp method to X509 class + - add "adobeTimeStamp" support in getExtParam + - src/asn1.js + - DERBoolean add support for "false" value. + - test/qunit-do-{asn1,asn1x509,x509}.html + - updated to follow above + Major update for CMS SigneData TimeStamp and CAdES * Changes from 9.1.9 to 10.0.0 (2020-Sep-24) - major update for CMS SignedData related classes diff --git a/README.md b/README.md index 72dfd0af..90a7e4e6 100755 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Your bugfix and pull request contribution are always welcomed :) NEWS ---- +- 2020-Oct-05: jsrsasign won [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2020/10/announcing-latest-google-open-source.html). Thank you Google. - 2020-Sep-23: 10.0.0 released for CMS SignedData related class including timestamp and CAdES architecture update - 2020-Aug-24: 9.1.0 released to new CRL APIs align with certificate - 2020-Aug-19: 9.0.0 released for major update of certificate and CSR generation and parsing without backward compatibility. Please see [migration guide](https://github.com/kjur/jsrsasign/wiki/NOTE-jsrsasign-8.0.x-to-9.0.0-Certificate-and-CSR-API-migration-guide) in detail. @@ -32,7 +33,7 @@ HIGHLIGHTS - no dependency to other library - no dependency to [W3C Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/) nor [OpenSSL](https://www.openssl.org/) - no dependency on newer ECMAScirpt function. So old browsers also supported. -- very popular crypto library with [0.6M+ npm downloads/month](https://npm-stat.com/charts.html?package=jsrsasign&from=2016-05-01&to=2020-09-02) +- very popular crypto library with [0.6M+ npm downloads/month](https://npm-stat.com/charts.html?package=jsrsasign&from=2016-05-01&to=2020-10-11) INSTALL ------- diff --git a/api/files.html b/api/files.html index 4a3d2008..9724605b 100644 --- a/api/files.html +++ b/api/files.html @@ -382,6 +382,8 @@

Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • @@ -515,7 +517,7 @@

    asn1-1.0.js

    Version:
    -
    jsrsasign 10.0.0 asn1 1.0.19 (2020-Sep-22)
    +
    jsrsasign 10.0.1 asn1 1.0.20 (2020-Oct-11)
    @@ -648,7 +650,7 @@

    asn1x509-1.0.js

    Version:
    -
    jsrsasign 10.0.0 asn1x509 2.1.3 (2020-Sep-22)
    +
    jsrsasign 10.0.1 asn1x509 2.1.4 (2020-Oct-12)
    @@ -876,7 +878,7 @@

    x509-1.1.js

    Version:
    -
    jsrsasign 10.0.0 x509 2.0.4 (2020-Sep-22)
    +
    jsrsasign 10.0.1 x509 2.0.5 (2020-Oct-11)
    diff --git a/api/index.html b/api/index.html index 5fdf5963..26642eba 100644 --- a/api/index.html +++ b/api/index.html @@ -382,6 +382,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • @@ -1092,6 +1094,12 @@

    KJUR.asn1.x509


    +
    +

    KJUR.asn1.x509.AdobeTimeStamp

    + AdobeTimeStamp X.509v3 extension ASN.1 encoder class +
    +
    +

    KJUR.asn1.x509.AlgorithmIdentifier

    AlgorithmIdentifier ASN.1 structure class diff --git a/api/symbols/ASN1HEX.html b/api/symbols/ASN1HEX.html index 68843320..baade533 100644 --- a/api/symbols/ASN1HEX.html +++ b/api/symbols/ASN1HEX.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/Base64x.html b/api/symbols/Base64x.html index 52516a9b..636dcbcb 100644 --- a/api/symbols/Base64x.html +++ b/api/symbols/Base64x.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KEYUTIL.html b/api/symbols/KEYUTIL.html index 903dfa50..2f577407 100644 --- a/api/symbols/KEYUTIL.html +++ b/api/symbols/KEYUTIL.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ASN1Object.html b/api/symbols/KJUR.asn1.ASN1Object.html index f76544ec..ec7093af 100644 --- a/api/symbols/KJUR.asn1.ASN1Object.html +++ b/api/symbols/KJUR.asn1.ASN1Object.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ASN1Util.html b/api/symbols/KJUR.asn1.ASN1Util.html index 3664571a..c4830a97 100644 --- a/api/symbols/KJUR.asn1.ASN1Util.html +++ b/api/symbols/KJUR.asn1.ASN1Util.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractString.html b/api/symbols/KJUR.asn1.DERAbstractString.html index 89f82f2f..717a474c 100644 --- a/api/symbols/KJUR.asn1.DERAbstractString.html +++ b/api/symbols/KJUR.asn1.DERAbstractString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractStructured.html b/api/symbols/KJUR.asn1.DERAbstractStructured.html index 6f1a8b1b..67e95219 100644 --- a/api/symbols/KJUR.asn1.DERAbstractStructured.html +++ b/api/symbols/KJUR.asn1.DERAbstractStructured.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractTime.html b/api/symbols/KJUR.asn1.DERAbstractTime.html index 617146ae..a625a4a4 100644 --- a/api/symbols/KJUR.asn1.DERAbstractTime.html +++ b/api/symbols/KJUR.asn1.DERAbstractTime.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERBMPString.html b/api/symbols/KJUR.asn1.DERBMPString.html index b7bba295..7fc718f3 100644 --- a/api/symbols/KJUR.asn1.DERBMPString.html +++ b/api/symbols/KJUR.asn1.DERBMPString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERBitString.html b/api/symbols/KJUR.asn1.DERBitString.html index 9928ef84..51a1a26c 100644 --- a/api/symbols/KJUR.asn1.DERBitString.html +++ b/api/symbols/KJUR.asn1.DERBitString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERBoolean.html b/api/symbols/KJUR.asn1.DERBoolean.html index 24fc6b71..285e24b1 100644 --- a/api/symbols/KJUR.asn1.DERBoolean.html +++ b/api/symbols/KJUR.asn1.DERBoolean.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • @@ -545,7 +547,7 @@

    KJUR.asn1.DERBoolean()

    class for ASN.1 DER Boolean -
    +In ASN.1 DER, DER Boolean "false" shall be omitted. @@ -591,12 +593,18 @@

    class for ASN.1 DER Boolean - +In ASN.1 DER, DER Boolean "false" shall be omitted. +However this supports boolean false for future BER support.
    +
    new KJUR.asn1.DERBoolean(true)
    +new KJUR.asn1.DERBoolean(false)
    + + + diff --git a/api/symbols/KJUR.asn1.DEREnumerated.html b/api/symbols/KJUR.asn1.DEREnumerated.html index 91cb0e85..4432115d 100644 --- a/api/symbols/KJUR.asn1.DEREnumerated.html +++ b/api/symbols/KJUR.asn1.DEREnumerated.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERGeneralizedTime.html b/api/symbols/KJUR.asn1.DERGeneralizedTime.html index 6dfe9485..577f8a55 100644 --- a/api/symbols/KJUR.asn1.DERGeneralizedTime.html +++ b/api/symbols/KJUR.asn1.DERGeneralizedTime.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERIA5String.html b/api/symbols/KJUR.asn1.DERIA5String.html index c58b872a..af1dd0b7 100644 --- a/api/symbols/KJUR.asn1.DERIA5String.html +++ b/api/symbols/KJUR.asn1.DERIA5String.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERInteger.html b/api/symbols/KJUR.asn1.DERInteger.html index 3a3536e1..14ac8a1a 100644 --- a/api/symbols/KJUR.asn1.DERInteger.html +++ b/api/symbols/KJUR.asn1.DERInteger.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERNull.html b/api/symbols/KJUR.asn1.DERNull.html index 85ffe2af..870cc042 100644 --- a/api/symbols/KJUR.asn1.DERNull.html +++ b/api/symbols/KJUR.asn1.DERNull.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERNumericString.html b/api/symbols/KJUR.asn1.DERNumericString.html index f5e80672..79f2fdcb 100644 --- a/api/symbols/KJUR.asn1.DERNumericString.html +++ b/api/symbols/KJUR.asn1.DERNumericString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERObjectIdentifier.html b/api/symbols/KJUR.asn1.DERObjectIdentifier.html index 0692ce23..893982ac 100644 --- a/api/symbols/KJUR.asn1.DERObjectIdentifier.html +++ b/api/symbols/KJUR.asn1.DERObjectIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DEROctetString.html b/api/symbols/KJUR.asn1.DEROctetString.html index b9f2ad2a..66d208a0 100644 --- a/api/symbols/KJUR.asn1.DEROctetString.html +++ b/api/symbols/KJUR.asn1.DEROctetString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERPrintableString.html b/api/symbols/KJUR.asn1.DERPrintableString.html index 11a0fe84..c4ad7031 100644 --- a/api/symbols/KJUR.asn1.DERPrintableString.html +++ b/api/symbols/KJUR.asn1.DERPrintableString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERSequence.html b/api/symbols/KJUR.asn1.DERSequence.html index 1b3060df..1882706a 100644 --- a/api/symbols/KJUR.asn1.DERSequence.html +++ b/api/symbols/KJUR.asn1.DERSequence.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERSet.html b/api/symbols/KJUR.asn1.DERSet.html index 642d1b62..94f55e12 100644 --- a/api/symbols/KJUR.asn1.DERSet.html +++ b/api/symbols/KJUR.asn1.DERSet.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERTaggedObject.html b/api/symbols/KJUR.asn1.DERTaggedObject.html index 6e5ec43b..3f119a9c 100644 --- a/api/symbols/KJUR.asn1.DERTaggedObject.html +++ b/api/symbols/KJUR.asn1.DERTaggedObject.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERTeletexString.html b/api/symbols/KJUR.asn1.DERTeletexString.html index f5f453c2..02055765 100644 --- a/api/symbols/KJUR.asn1.DERTeletexString.html +++ b/api/symbols/KJUR.asn1.DERTeletexString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERUTCTime.html b/api/symbols/KJUR.asn1.DERUTCTime.html index 62eed589..205ecacf 100644 --- a/api/symbols/KJUR.asn1.DERUTCTime.html +++ b/api/symbols/KJUR.asn1.DERUTCTime.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERUTF8String.html b/api/symbols/KJUR.asn1.DERUTF8String.html index 55f265ef..245194aa 100644 --- a/api/symbols/KJUR.asn1.DERUTF8String.html +++ b/api/symbols/KJUR.asn1.DERUTF8String.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.DERVisibleString.html b/api/symbols/KJUR.asn1.DERVisibleString.html index 2ac650fe..d39e75e9 100644 --- a/api/symbols/KJUR.asn1.DERVisibleString.html +++ b/api/symbols/KJUR.asn1.DERVisibleString.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.CAdESUtil.html b/api/symbols/KJUR.asn1.cades.CAdESUtil.html index b1acf5b6..1b732ca3 100644 --- a/api/symbols/KJUR.asn1.cades.CAdESUtil.html +++ b/api/symbols/KJUR.asn1.cades.CAdESUtil.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html index bd241f3e..467602a1 100644 --- a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html +++ b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherCertID.html b/api/symbols/KJUR.asn1.cades.OtherCertID.html index 92c26acf..bf767eb6 100644 --- a/api/symbols/KJUR.asn1.cades.OtherCertID.html +++ b/api/symbols/KJUR.asn1.cades.OtherCertID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHash.html b/api/symbols/KJUR.asn1.cades.OtherHash.html index 0166ebc2..439481cd 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHash.html +++ b/api/symbols/KJUR.asn1.cades.OtherHash.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html index cb4dee24..8126a234 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashValue.html b/api/symbols/KJUR.asn1.cades.OtherHashValue.html index 0b6053d7..0fc0b30c 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashValue.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html index 6eaa86b8..cb1370e3 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyId.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html index 1598a8c9..0b8048f6 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html index 779879ae..780bd5c4 100644 --- a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html +++ b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cades.html b/api/symbols/KJUR.asn1.cades.html index 22c826b7..86d5a603 100644 --- a/api/symbols/KJUR.asn1.cades.html +++ b/api/symbols/KJUR.asn1.cades.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.Attribute.html b/api/symbols/KJUR.asn1.cms.Attribute.html index c5d498b2..02e81397 100644 --- a/api/symbols/KJUR.asn1.cms.Attribute.html +++ b/api/symbols/KJUR.asn1.cms.Attribute.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.AttributeList.html b/api/symbols/KJUR.asn1.cms.AttributeList.html index 3b2de9fb..3d82b3b4 100644 --- a/api/symbols/KJUR.asn1.cms.AttributeList.html +++ b/api/symbols/KJUR.asn1.cms.AttributeList.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.CMSUtil.html b/api/symbols/KJUR.asn1.cms.CMSUtil.html index 8041593b..7911bbde 100644 --- a/api/symbols/KJUR.asn1.cms.CMSUtil.html +++ b/api/symbols/KJUR.asn1.cms.CMSUtil.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.CertificateSet.html b/api/symbols/KJUR.asn1.cms.CertificateSet.html index 85355254..232af6f4 100644 --- a/api/symbols/KJUR.asn1.cms.CertificateSet.html +++ b/api/symbols/KJUR.asn1.cms.CertificateSet.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentInfo.html b/api/symbols/KJUR.asn1.cms.ContentInfo.html index ae1c0133..09d1d8de 100644 --- a/api/symbols/KJUR.asn1.cms.ContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.ContentInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentType.html b/api/symbols/KJUR.asn1.cms.ContentType.html index 98cfca9d..d3add78f 100644 --- a/api/symbols/KJUR.asn1.cms.ContentType.html +++ b/api/symbols/KJUR.asn1.cms.ContentType.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.ESSCertID.html b/api/symbols/KJUR.asn1.cms.ESSCertID.html index e5f4878f..a3635d97 100644 --- a/api/symbols/KJUR.asn1.cms.ESSCertID.html +++ b/api/symbols/KJUR.asn1.cms.ESSCertID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html b/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html index 30d7112e..5a634f74 100644 --- a/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html +++ b/api/symbols/KJUR.asn1.cms.ESSCertIDv2.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html index d1a4c830..68361a27 100644 --- a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html index 15b02ecc..a63c9950 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html +++ b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerSerial.html b/api/symbols/KJUR.asn1.cms.IssuerSerial.html index 9c565331..c91064c1 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerSerial.html +++ b/api/symbols/KJUR.asn1.cms.IssuerSerial.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.MessageDigest.html b/api/symbols/KJUR.asn1.cms.MessageDigest.html index 4e2a4fb8..6515b392 100644 --- a/api/symbols/KJUR.asn1.cms.MessageDigest.html +++ b/api/symbols/KJUR.asn1.cms.MessageDigest.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html b/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html index b7e16709..42856952 100644 --- a/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html +++ b/api/symbols/KJUR.asn1.cms.OtherRevocationFormat.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html b/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html index fe943c7f..a45fe129 100644 --- a/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html +++ b/api/symbols/KJUR.asn1.cms.RevocationInfoChoice.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html b/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html index 33c8d640..dd64a55e 100644 --- a/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html +++ b/api/symbols/KJUR.asn1.cms.RevocationInfoChoices.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SignedData.html b/api/symbols/KJUR.asn1.cms.SignedData.html index bfe93c73..5371be52 100644 --- a/api/symbols/KJUR.asn1.cms.SignedData.html +++ b/api/symbols/KJUR.asn1.cms.SignedData.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerIdentifier.html b/api/symbols/KJUR.asn1.cms.SignerIdentifier.html index e5564b17..e7dbfeb6 100644 --- a/api/symbols/KJUR.asn1.cms.SignerIdentifier.html +++ b/api/symbols/KJUR.asn1.cms.SignerIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerInfo.html b/api/symbols/KJUR.asn1.cms.SignerInfo.html index d16d82c1..64e50bc1 100644 --- a/api/symbols/KJUR.asn1.cms.SignerInfo.html +++ b/api/symbols/KJUR.asn1.cms.SignerInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificate.html b/api/symbols/KJUR.asn1.cms.SigningCertificate.html index 41153f07..379c3b55 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificate.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificate.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html index 5c15ab53..1058eae9 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningTime.html b/api/symbols/KJUR.asn1.cms.SigningTime.html index 973f31e0..5be8d8a1 100644 --- a/api/symbols/KJUR.asn1.cms.SigningTime.html +++ b/api/symbols/KJUR.asn1.cms.SigningTime.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html b/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html index f63df161..b86ad100 100644 --- a/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.cms.SubjectKeyIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.cms.html b/api/symbols/KJUR.asn1.cms.html index cd0cd540..6381c6d6 100644 --- a/api/symbols/KJUR.asn1.cms.html +++ b/api/symbols/KJUR.asn1.cms.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.csr.CSRUtil.html b/api/symbols/KJUR.asn1.csr.CSRUtil.html index a5c4763e..80224559 100644 --- a/api/symbols/KJUR.asn1.csr.CSRUtil.html +++ b/api/symbols/KJUR.asn1.csr.CSRUtil.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequest.html b/api/symbols/KJUR.asn1.csr.CertificationRequest.html index 6a10c3fa..3225f4c4 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequest.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequest.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html index 9b7a9ab1..f0e8f02d 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.csr.html b/api/symbols/KJUR.asn1.csr.html index 4695bbc7..2ee783f3 100644 --- a/api/symbols/KJUR.asn1.csr.html +++ b/api/symbols/KJUR.asn1.csr.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.html b/api/symbols/KJUR.asn1.html index 7aa6113c..385f6e35 100644 --- a/api/symbols/KJUR.asn1.html +++ b/api/symbols/KJUR.asn1.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html b/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html index c9ae69a3..7f0c4de3 100644 --- a/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.BasicOCSPResponse.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertID.html b/api/symbols/KJUR.asn1.ocsp.CertID.html index 15eb51a9..b897dd33 100644 --- a/api/symbols/KJUR.asn1.ocsp.CertID.html +++ b/api/symbols/KJUR.asn1.ocsp.CertID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertStatus.html b/api/symbols/KJUR.asn1.ocsp.CertStatus.html index 9c406e46..ea5f3137 100644 --- a/api/symbols/KJUR.asn1.ocsp.CertStatus.html +++ b/api/symbols/KJUR.asn1.ocsp.CertStatus.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPParser.html b/api/symbols/KJUR.asn1.ocsp.OCSPParser.html index e98cc232..9e6cde15 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPParser.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPParser.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html index 23637827..186e80d7 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html b/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html index a91fde65..d7e90b9b 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPResponse.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html index 72186254..8699c976 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.Request.html b/api/symbols/KJUR.asn1.ocsp.Request.html index 2ceebea0..c97ef236 100644 --- a/api/symbols/KJUR.asn1.ocsp.Request.html +++ b/api/symbols/KJUR.asn1.ocsp.Request.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponderID.html b/api/symbols/KJUR.asn1.ocsp.ResponderID.html index 72a69aa8..ae538988 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponderID.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponderID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html b/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html index d9213204..411a04a8 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponseBytes.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.ResponseData.html b/api/symbols/KJUR.asn1.ocsp.ResponseData.html index 9eb18c72..70e0eec5 100644 --- a/api/symbols/KJUR.asn1.ocsp.ResponseData.html +++ b/api/symbols/KJUR.asn1.ocsp.ResponseData.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.SingleResponse.html b/api/symbols/KJUR.asn1.ocsp.SingleResponse.html index e7479214..bf9ee1ee 100644 --- a/api/symbols/KJUR.asn1.ocsp.SingleResponse.html +++ b/api/symbols/KJUR.asn1.ocsp.SingleResponse.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html b/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html index d424cdef..9bdc9293 100644 --- a/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html +++ b/api/symbols/KJUR.asn1.ocsp.SingleResponseList.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html index 132284ff..85dccc23 100644 --- a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.ocsp.html b/api/symbols/KJUR.asn1.ocsp.html index 767fafd4..f34d7759 100644 --- a/api/symbols/KJUR.asn1.ocsp.html +++ b/api/symbols/KJUR.asn1.ocsp.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html index 43e24002..422fe279 100644 --- a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.Accuracy.html b/api/symbols/KJUR.asn1.tsp.Accuracy.html index e65e8fa2..011bb1b2 100644 --- a/api/symbols/KJUR.asn1.tsp.Accuracy.html +++ b/api/symbols/KJUR.asn1.tsp.Accuracy.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html index 0ccda1ae..7130b8dd 100644 --- a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.MessageImprint.html b/api/symbols/KJUR.asn1.tsp.MessageImprint.html index 4a86aef9..16e61e79 100644 --- a/api/symbols/KJUR.asn1.tsp.MessageImprint.html +++ b/api/symbols/KJUR.asn1.tsp.MessageImprint.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html index 4c891929..ae7c8fb3 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html index 1321da53..8f207f72 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatus.html b/api/symbols/KJUR.asn1.tsp.PKIStatus.html index 20512203..6a0e5085 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatus.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatus.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html index 2cc07fdc..c53443aa 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html index f0c98870..5bd605a8 100644 --- a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSPUtil.html b/api/symbols/KJUR.asn1.tsp.TSPUtil.html index e76971bd..7387b335 100644 --- a/api/symbols/KJUR.asn1.tsp.TSPUtil.html +++ b/api/symbols/KJUR.asn1.tsp.TSPUtil.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSTInfo.html b/api/symbols/KJUR.asn1.tsp.TSTInfo.html index a08f8cd0..2c50f1f2 100644 --- a/api/symbols/KJUR.asn1.tsp.TSTInfo.html +++ b/api/symbols/KJUR.asn1.tsp.TSTInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html index 0c021676..ce571ece 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html index 780c946e..9bb67a14 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampToken.html b/api/symbols/KJUR.asn1.tsp.TimeStampToken.html index afe583a7..3cf3c080 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampToken.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampToken.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.tsp.html b/api/symbols/KJUR.asn1.tsp.html index f8dd1657..85702846 100644 --- a/api/symbols/KJUR.asn1.tsp.html +++ b/api/symbols/KJUR.asn1.tsp.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html index c6d40e53..99b3ddf7 100644 --- a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html index 8eb94a05..3391ad0a 100644 --- a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html +++ b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html index 71bceee6..85c7b9d4 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html index 0b6adf34..6e2cdf9c 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.BasicConstraints.html b/api/symbols/KJUR.asn1.x509.BasicConstraints.html index 2d9fdc4e..5c6242e9 100644 --- a/api/symbols/KJUR.asn1.x509.BasicConstraints.html +++ b/api/symbols/KJUR.asn1.x509.BasicConstraints.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CRL.html b/api/symbols/KJUR.asn1.x509.CRL.html index 054521a7..4034280a 100644 --- a/api/symbols/KJUR.asn1.x509.CRL.html +++ b/api/symbols/KJUR.asn1.x509.CRL.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html index f05e327e..8788c88f 100644 --- a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html +++ b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLEntry.html b/api/symbols/KJUR.asn1.x509.CRLEntry.html index f6e9f796..3c833b1a 100644 --- a/api/symbols/KJUR.asn1.x509.CRLEntry.html +++ b/api/symbols/KJUR.asn1.x509.CRLEntry.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLNumber.html b/api/symbols/KJUR.asn1.x509.CRLNumber.html index 75882cc3..35f5c792 100644 --- a/api/symbols/KJUR.asn1.x509.CRLNumber.html +++ b/api/symbols/KJUR.asn1.x509.CRLNumber.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLReason.html b/api/symbols/KJUR.asn1.x509.CRLReason.html index 9cf915f7..20b81edc 100644 --- a/api/symbols/KJUR.asn1.x509.CRLReason.html +++ b/api/symbols/KJUR.asn1.x509.CRLReason.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.Certificate.html b/api/symbols/KJUR.asn1.x509.Certificate.html index 56d593f3..28c986cc 100644 --- a/api/symbols/KJUR.asn1.x509.Certificate.html +++ b/api/symbols/KJUR.asn1.x509.Certificate.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.CertificatePolicies.html b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html index 6560ef6d..78d2906f 100644 --- a/api/symbols/KJUR.asn1.x509.CertificatePolicies.html +++ b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.DisplayText.html b/api/symbols/KJUR.asn1.x509.DisplayText.html index 7c97f922..1e52b71d 100644 --- a/api/symbols/KJUR.asn1.x509.DisplayText.html +++ b/api/symbols/KJUR.asn1.x509.DisplayText.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPoint.html b/api/symbols/KJUR.asn1.x509.DistributionPoint.html index 19b43e8f..9a89b285 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPoint.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPoint.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPointName.html b/api/symbols/KJUR.asn1.x509.DistributionPointName.html index 8138f90e..c3c798b6 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPointName.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPointName.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html index 01e1ad4b..252587f6 100644 --- a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.Extension.html b/api/symbols/KJUR.asn1.x509.Extension.html index fb4691fd..0616765b 100644 --- a/api/symbols/KJUR.asn1.x509.Extension.html +++ b/api/symbols/KJUR.asn1.x509.Extension.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.Extensions.html b/api/symbols/KJUR.asn1.x509.Extensions.html index bebd9545..a2e23841 100644 --- a/api/symbols/KJUR.asn1.x509.Extensions.html +++ b/api/symbols/KJUR.asn1.x509.Extensions.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralName.html b/api/symbols/KJUR.asn1.x509.GeneralName.html index ffda6add..8e468de8 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralName.html +++ b/api/symbols/KJUR.asn1.x509.GeneralName.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralNames.html b/api/symbols/KJUR.asn1.x509.GeneralNames.html index 44108838..b97c1d6a 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralNames.html +++ b/api/symbols/KJUR.asn1.x509.GeneralNames.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.IssuerAltName.html b/api/symbols/KJUR.asn1.x509.IssuerAltName.html index e99fbbf8..bcf1f911 100644 --- a/api/symbols/KJUR.asn1.x509.IssuerAltName.html +++ b/api/symbols/KJUR.asn1.x509.IssuerAltName.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.KeyUsage.html b/api/symbols/KJUR.asn1.x509.KeyUsage.html index 7824f11d..0a28c0a4 100644 --- a/api/symbols/KJUR.asn1.x509.KeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.KeyUsage.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.NoticeReference.html b/api/symbols/KJUR.asn1.x509.NoticeReference.html index 4268416f..21a611c0 100644 --- a/api/symbols/KJUR.asn1.x509.NoticeReference.html +++ b/api/symbols/KJUR.asn1.x509.NoticeReference.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html b/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html index 012a975e..37ff5f09 100644 --- a/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html +++ b/api/symbols/KJUR.asn1.x509.OCSPNoCheck.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.OCSPNonce.html b/api/symbols/KJUR.asn1.x509.OCSPNonce.html index e1e3e520..94b0ad6e 100644 --- a/api/symbols/KJUR.asn1.x509.OCSPNonce.html +++ b/api/symbols/KJUR.asn1.x509.OCSPNonce.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.OID.html b/api/symbols/KJUR.asn1.x509.OID.html index 1b037fda..12fef6e2 100644 --- a/api/symbols/KJUR.asn1.x509.OID.html +++ b/api/symbols/KJUR.asn1.x509.OID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyInformation.html b/api/symbols/KJUR.asn1.x509.PolicyInformation.html index f4eabcb9..1afedaed 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyInformation.html +++ b/api/symbols/KJUR.asn1.x509.PolicyInformation.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html index 54c19c43..3d536c46 100644 --- a/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html +++ b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.PrivateExtension.html b/api/symbols/KJUR.asn1.x509.PrivateExtension.html index ea2cd672..72fa5174 100644 --- a/api/symbols/KJUR.asn1.x509.PrivateExtension.html +++ b/api/symbols/KJUR.asn1.x509.PrivateExtension.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.RDN.html b/api/symbols/KJUR.asn1.x509.RDN.html index fa692ec9..a8f7a069 100644 --- a/api/symbols/KJUR.asn1.x509.RDN.html +++ b/api/symbols/KJUR.asn1.x509.RDN.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectAltName.html b/api/symbols/KJUR.asn1.x509.SubjectAltName.html index 9027eab8..1dbd1ab2 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectAltName.html +++ b/api/symbols/KJUR.asn1.x509.SubjectAltName.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html index a06f7c9f..43cdcd0e 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html index 8d79bf89..e44bc7a3 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html +++ b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertList.html b/api/symbols/KJUR.asn1.x509.TBSCertList.html index 53030196..3b63f82d 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertList.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertList.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertificate.html b/api/symbols/KJUR.asn1.x509.TBSCertificate.html index 7799c6a2..385fd5eb 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertificate.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertificate.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.Time.html b/api/symbols/KJUR.asn1.x509.Time.html index 9cddb18a..960a00fa 100644 --- a/api/symbols/KJUR.asn1.x509.Time.html +++ b/api/symbols/KJUR.asn1.x509.Time.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.UserNotice.html b/api/symbols/KJUR.asn1.x509.UserNotice.html index a7e69d51..9e64d921 100644 --- a/api/symbols/KJUR.asn1.x509.UserNotice.html +++ b/api/symbols/KJUR.asn1.x509.UserNotice.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.X500Name.html b/api/symbols/KJUR.asn1.x509.X500Name.html index 7d143af1..8b819d2d 100644 --- a/api/symbols/KJUR.asn1.x509.X500Name.html +++ b/api/symbols/KJUR.asn1.x509.X500Name.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.X509Util.html b/api/symbols/KJUR.asn1.x509.X509Util.html index 73cb3b0e..e20074ab 100644 --- a/api/symbols/KJUR.asn1.x509.X509Util.html +++ b/api/symbols/KJUR.asn1.x509.X509Util.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.asn1.x509.html b/api/symbols/KJUR.asn1.x509.html index 64aca40c..a1e6f1d4 100644 --- a/api/symbols/KJUR.asn1.x509.html +++ b/api/symbols/KJUR.asn1.x509.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.Cipher.html b/api/symbols/KJUR.crypto.Cipher.html index 54affdb4..d88e7339 100644 --- a/api/symbols/KJUR.crypto.Cipher.html +++ b/api/symbols/KJUR.crypto.Cipher.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.DSA.html b/api/symbols/KJUR.crypto.DSA.html index 5179ed0d..39e065eb 100644 --- a/api/symbols/KJUR.crypto.DSA.html +++ b/api/symbols/KJUR.crypto.DSA.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.ECDSA.html b/api/symbols/KJUR.crypto.ECDSA.html index 91eb0048..9355cd15 100644 --- a/api/symbols/KJUR.crypto.ECDSA.html +++ b/api/symbols/KJUR.crypto.ECDSA.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.ECParameterDB.html b/api/symbols/KJUR.crypto.ECParameterDB.html index 3c5e5071..7f443d4a 100644 --- a/api/symbols/KJUR.crypto.ECParameterDB.html +++ b/api/symbols/KJUR.crypto.ECParameterDB.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.Mac.html b/api/symbols/KJUR.crypto.Mac.html index 0d7f3b13..8daef64b 100644 --- a/api/symbols/KJUR.crypto.Mac.html +++ b/api/symbols/KJUR.crypto.Mac.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.MessageDigest.html b/api/symbols/KJUR.crypto.MessageDigest.html index 895eb079..5775cb71 100644 --- a/api/symbols/KJUR.crypto.MessageDigest.html +++ b/api/symbols/KJUR.crypto.MessageDigest.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.OID.html b/api/symbols/KJUR.crypto.OID.html index 1349a962..0b7c8e20 100644 --- a/api/symbols/KJUR.crypto.OID.html +++ b/api/symbols/KJUR.crypto.OID.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.Signature.html b/api/symbols/KJUR.crypto.Signature.html index fc929ce1..b360e123 100644 --- a/api/symbols/KJUR.crypto.Signature.html +++ b/api/symbols/KJUR.crypto.Signature.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.Util.html b/api/symbols/KJUR.crypto.Util.html index eb3e9a95..7dd3d54c 100644 --- a/api/symbols/KJUR.crypto.Util.html +++ b/api/symbols/KJUR.crypto.Util.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.crypto.html b/api/symbols/KJUR.crypto.html index 0eb67d8f..b8d3242e 100644 --- a/api/symbols/KJUR.crypto.html +++ b/api/symbols/KJUR.crypto.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.html b/api/symbols/KJUR.html index 1a08c016..a6c9cfb9 100644 --- a/api/symbols/KJUR.html +++ b/api/symbols/KJUR.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.jws.IntDate.html b/api/symbols/KJUR.jws.IntDate.html index 9a367c09..f4ca60f6 100644 --- a/api/symbols/KJUR.jws.IntDate.html +++ b/api/symbols/KJUR.jws.IntDate.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.jws.JWS.html b/api/symbols/KJUR.jws.JWS.html index 234edc0e..adeb6428 100644 --- a/api/symbols/KJUR.jws.JWS.html +++ b/api/symbols/KJUR.jws.JWS.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.jws.JWSJS.html b/api/symbols/KJUR.jws.JWSJS.html index b324c787..fa500f23 100644 --- a/api/symbols/KJUR.jws.JWSJS.html +++ b/api/symbols/KJUR.jws.JWSJS.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.jws.html b/api/symbols/KJUR.jws.html index e5c4161e..49b7fe4c 100644 --- a/api/symbols/KJUR.jws.html +++ b/api/symbols/KJUR.jws.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/KJUR.lang.String.html b/api/symbols/KJUR.lang.String.html index 9b409237..7cfa808e 100644 --- a/api/symbols/KJUR.lang.String.html +++ b/api/symbols/KJUR.lang.String.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/RSAKey.html b/api/symbols/RSAKey.html index 951e6b81..19f78cc8 100644 --- a/api/symbols/RSAKey.html +++ b/api/symbols/RSAKey.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/X509.html b/api/symbols/X509.html index 420a5207..148ffe4d 100644 --- a/api/symbols/X509.html +++ b/api/symbols/X509.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • @@ -670,6 +672,19 @@

    + +   + +
    getExtAdobeTimeStamp(hExtV, critical) +
    +
    parse AdobeTimeStamp extension as JSON object
    +This method parses +X.509v3 AdobeTimeStamp private extension value defined in the + +Adobe site as JSON object.
    + + +   @@ -1869,6 +1884,92 @@

    +
    + + +
    + + {Array} + getExtAdobeTimeStamp(hExtV, critical) + +
    +
    + parse AdobeTimeStamp extension as JSON object
    +This method parses +X.509v3 AdobeTimeStamp private extension value defined in the + +Adobe site as JSON object. +This extension provides the URL location for time stamp service. +
    +adbe- OBJECT IDENTIFIER ::=  { adbe(1.2.840.113583) acrobat(1) security(1) x509Ext(9) 1 }
    + ::= SEQUENCE {
    +    version INTEGER  { v1(1) }, -- extension version
    +    location GeneralName (In v1 GeneralName can be only uniformResourceIdentifier)
    +    requiresAuth        boolean (default false), OPTIONAL }
    +
    +
    +Result of this method can be passed to +KJUR.asn1.x509.AdobeTimeStamp constructor. + + +
    + + + +
    x.getExtAdobeTimeStamp(<>) →
    +{ extname: "adobeTimeStamp", uri: "http://tsa.example.com/" reqauth: true }
    + + + + +
    +
    Parameters:
    + +
    + {String} hExtV + +
    +
    hexadecimal string of extension value
    + +
    + {Boolean} critical + +
    +
    flag
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 10.0.1 x509 2.0.5
    +
    + + + + +
    +
    Returns:
    + +
    {Array} JSON object of parsed AdobeTimeStamp extension
    + +
    + + + +
    +
    See:
    + +
    + +
    + +
    + +
    + +
    diff --git a/api/symbols/X509CRL.html b/api/symbols/X509CRL.html index 32d799fa..14202487 100644 --- a/api/symbols/X509CRL.html +++ b/api/symbols/X509CRL.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/global__.html b/api/symbols/global__.html index cfac5530..2ed02e9b 100644 --- a/api/symbols/global__.html +++ b/api/symbols/global__.html @@ -387,6 +387,8 @@

    Classes

  • KJUR.asn1.x509
  • +
  • KJUR.asn1.x509.AdobeTimeStamp
  • +
  • KJUR.asn1.x509.AlgorithmIdentifier
  • KJUR.asn1.x509.AttributeTypeAndValue
  • diff --git a/api/symbols/src/asn1-1.0.js.html b/api/symbols/src/asn1-1.0.js.html index 8fc421de..cbf54a77 100644 --- a/api/symbols/src/asn1-1.0.js.html +++ b/api/symbols/src/asn1-1.0.js.html @@ -5,7 +5,7 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 /* asn1-1.0.19.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
    +	
      1 /* asn1-1.0.20.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
       2  */
       3 /*
       4  * asn1.js - ASN.1 DER encoder classes
    @@ -23,7 +23,7 @@
      16  * @fileOverview
      17  * @name asn1-1.0.js
      18  * @author Kenji Urushima kenji.urushima@gmail.com
    - 19  * @version jsrsasign 10.0.0 asn1 1.0.19 (2020-Sep-22)
    + 19  * @version jsrsasign 10.0.1 asn1 1.0.20 (2020-Oct-11)
      20  * @since jsrsasign 2.1
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -797,992 +797,1000 @@
     790  * @name KJUR.asn1.DERBoolean
     791  * @class class for ASN.1 DER Boolean
     792  * @extends KJUR.asn1.ASN1Object
    -793  * @description
    -794  * @see KJUR.asn1.ASN1Object - superclass
    -795  */
    -796 KJUR.asn1.DERBoolean = function() {
    -797     KJUR.asn1.DERBoolean.superclass.constructor.call(this);
    -798     this.hT = "01";
    -799     this.hTLV = "0101ff";
    -800 };
    -801 YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
    -802 
    -803 // ********************************************************************
    -804 /**
    -805  * class for ASN.1 DER Integer
    -806  * @name KJUR.asn1.DERInteger
    -807  * @class class for ASN.1 DER Integer
    -808  * @extends KJUR.asn1.ASN1Object
    -809  * @description
    -810  * <br/>
    -811  * As for argument 'params' for constructor, you can specify one of
    -812  * following properties:
    -813  * <ul>
    -814  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    -815  * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
    -816  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -817  * </ul>
    -818  * NOTE: 'params' can be omitted.
    -819  */
    -820 KJUR.asn1.DERInteger = function(params) {
    -821     KJUR.asn1.DERInteger.superclass.constructor.call(this);
    -822     this.hT = "02";
    -823 
    -824     /**
    -825      * set value by Tom Wu's BigInteger object
    -826      * @name setByBigInteger
    -827      * @memberOf KJUR.asn1.DERInteger#
    -828      * @function
    -829      * @param {BigInteger} bigIntegerValue to set
    -830      */
    -831     this.setByBigInteger = function(bigIntegerValue) {
    -832         this.hTLV = null;
    -833         this.isModified = true;
    -834         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    -835     };
    -836 
    -837     /**
    -838      * set value by integer value
    -839      * @name setByInteger
    -840      * @memberOf KJUR.asn1.DERInteger
    -841      * @function
    -842      * @param {Integer} integer value to set
    -843      */
    -844     this.setByInteger = function(intValue) {
    -845         var bi = new BigInteger(String(intValue), 10);
    -846         this.setByBigInteger(bi);
    -847     };
    -848 
    -849     /**
    -850      * set value by integer value
    -851      * @name setValueHex
    -852      * @memberOf KJUR.asn1.DERInteger#
    -853      * @function
    -854      * @param {String} hexadecimal string of integer value
    -855      * @description
    -856      * <br/>
    -857      * NOTE: Value shall be represented by minimum octet length of
    -858      * two's complement representation.
    -859      * @example
    -860      * new KJUR.asn1.DERInteger(123);
    -861      * new KJUR.asn1.DERInteger({'int': 123});
    -862      * new KJUR.asn1.DERInteger({'hex': '1fad'});
    -863      */
    -864     this.setValueHex = function(newHexString) {
    -865         this.hV = newHexString;
    -866     };
    -867 
    -868     this.getFreshValueHex = function() {
    -869         return this.hV;
    -870     };
    -871 
    -872     if (typeof params != "undefined") {
    -873         if (typeof params['bigint'] != "undefined") {
    -874             this.setByBigInteger(params['bigint']);
    -875         } else if (typeof params['int'] != "undefined") {
    -876             this.setByInteger(params['int']);
    -877         } else if (typeof params == "number") {
    -878             this.setByInteger(params);
    -879         } else if (typeof params['hex'] != "undefined") {
    -880             this.setValueHex(params['hex']);
    -881         }
    -882     }
    -883 };
    -884 YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
    -885 
    -886 // ********************************************************************
    -887 /**
    -888  * class for ASN.1 DER encoded BitString primitive
    -889  * @name KJUR.asn1.DERBitString
    -890  * @class class for ASN.1 DER encoded BitString primitive
    -891  * @extends KJUR.asn1.ASN1Object
    -892  * @description 
    -893  * <br/>
    -894  * As for argument 'params' for constructor, you can specify one of
    -895  * following properties:
    -896  * <ul>
    -897  * <li>bin - specify binary string (ex. '10111')</li>
    -898  * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
    -899  * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
    -900  * <li>obj - specify {@link KJUR.asn1.ASN1Util.newObject} 
    -901  * argument for "BitString encapsulates" structure.</li>
    -902  * </ul>
    -903  * NOTE1: 'params' can be omitted.<br/>
    -904  * NOTE2: 'obj' parameter have been supported since
    -905  * asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).<br/>
    -906  * @example
    -907  * // default constructor
    -908  * o = new KJUR.asn1.DERBitString();
    -909  * // initialize with binary string
    -910  * o = new KJUR.asn1.DERBitString({bin: "1011"});
    -911  * // initialize with boolean array
    -912  * o = new KJUR.asn1.DERBitString({array: [true,false,true,true]});
    -913  * // initialize with hexadecimal string (04 is unused bits)
    -914  * o = new KJUR.asn1.DEROctetString({hex: "04bac0"});
    -915  * // initialize with ASN1Util.newObject argument for encapsulated
    -916  * o = new KJUR.asn1.DERBitString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    -917  * // above generates a ASN.1 data like this:
    -918  * // BIT STRING, encapsulates {
    -919  * //   SEQUENCE {
    -920  * //     INTEGER 3
    -921  * //     PrintableString 'aaa'
    -922  * //     }
    -923  * //   } 
    -924  */
    -925 KJUR.asn1.DERBitString = function(params) {
    -926     if (params !== undefined && typeof params.obj !== "undefined") {
    -927 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    -928 	params.hex = "00" + o.getEncodedHex();
    -929     }
    -930     KJUR.asn1.DERBitString.superclass.constructor.call(this);
    -931     this.hT = "03";
    -932 
    -933     /**
    -934      * set ASN.1 value(V) by a hexadecimal string including unused bits
    -935      * @name setHexValueIncludingUnusedBits
    -936      * @memberOf KJUR.asn1.DERBitString#
    -937      * @function
    -938      * @param {String} newHexStringIncludingUnusedBits
    -939      */
    -940     this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
    -941         this.hTLV = null;
    -942         this.isModified = true;
    -943         this.hV = newHexStringIncludingUnusedBits;
    -944     };
    -945 
    -946     /**
    -947      * set ASN.1 value(V) by unused bit and hexadecimal string of value
    -948      * @name setUnusedBitsAndHexValue
    -949      * @memberOf KJUR.asn1.DERBitString#
    -950      * @function
    -951      * @param {Integer} unusedBits
    -952      * @param {String} hValue
    -953      */
    -954     this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
    -955         if (unusedBits < 0 || 7 < unusedBits) {
    -956             throw "unused bits shall be from 0 to 7: u = " + unusedBits;
    -957         }
    -958         var hUnusedBits = "0" + unusedBits;
    -959         this.hTLV = null;
    -960         this.isModified = true;
    -961         this.hV = hUnusedBits + hValue;
    -962     };
    -963 
    -964     /**
    -965      * set ASN.1 DER BitString by binary string<br/>
    -966      * @name setByBinaryString
    -967      * @memberOf KJUR.asn1.DERBitString#
    -968      * @function
    -969      * @param {String} binaryString binary value string (i.e. '10111')
    -970      * @description
    -971      * Its unused bits will be calculated automatically by length of 
    -972      * 'binaryValue'. <br/>
    -973      * NOTE: Trailing zeros '0' will be ignored.
    -974      * @example
    -975      * o = new KJUR.asn1.DERBitString();
    -976      * o.setByBooleanArray("01011");
    -977      */
    -978     this.setByBinaryString = function(binaryString) {
    -979         binaryString = binaryString.replace(/0+$/, '');
    -980         var unusedBits = 8 - binaryString.length % 8;
    -981         if (unusedBits == 8) unusedBits = 0;
    -982         for (var i = 0; i <= unusedBits; i++) {
    -983             binaryString += '0';
    -984         }
    -985         var h = '';
    -986         for (var i = 0; i < binaryString.length - 1; i += 8) {
    -987             var b = binaryString.substr(i, 8);
    -988             var x = parseInt(b, 2).toString(16);
    -989             if (x.length == 1) x = '0' + x;
    -990             h += x;  
    -991         }
    -992         this.hTLV = null;
    -993         this.isModified = true;
    -994         this.hV = '0' + unusedBits + h;
    -995     };
    -996 
    -997     /**
    -998      * set ASN.1 TLV value(V) by an array of boolean<br/>
    -999      * @name setByBooleanArray
    -1000      * @memberOf KJUR.asn1.DERBitString#
    -1001      * @function
    -1002      * @param {array} booleanArray array of boolean (ex. [true, false, true])
    -1003      * @description
    -1004      * NOTE: Trailing falses will be ignored in the ASN.1 DER Object.
    -1005      * @example
    -1006      * o = new KJUR.asn1.DERBitString();
    -1007      * o.setByBooleanArray([false, true, false, true, true]);
    -1008      */
    -1009     this.setByBooleanArray = function(booleanArray) {
    -1010         var s = '';
    -1011         for (var i = 0; i < booleanArray.length; i++) {
    -1012             if (booleanArray[i] == true) {
    -1013                 s += '1';
    -1014             } else {
    -1015                 s += '0';
    -1016             }
    -1017         }
    -1018         this.setByBinaryString(s);
    -1019     };
    -1020 
    -1021     /**
    -1022      * generate an array of falses with specified length<br/>
    -1023      * @name newFalseArray
    -1024      * @memberOf KJUR.asn1.DERBitString
    -1025      * @function
    -1026      * @param {Integer} nLength length of array to generate
    -1027      * @return {array} array of boolean falses
    -1028      * @description
    -1029      * This static method may be useful to initialize boolean array.
    -1030      * @example
    -1031      * o = new KJUR.asn1.DERBitString();
    -1032      * o.newFalseArray(3) → [false, false, false]
    -1033      */
    -1034     this.newFalseArray = function(nLength) {
    -1035         var a = new Array(nLength);
    -1036         for (var i = 0; i < nLength; i++) {
    -1037             a[i] = false;
    -1038         }
    -1039         return a;
    -1040     };
    -1041 
    -1042     this.getFreshValueHex = function() {
    -1043         return this.hV;
    -1044     };
    -1045 
    -1046     if (typeof params != "undefined") {
    -1047         if (typeof params == "string" && params.toLowerCase().match(/^[0-9a-f]+$/)) {
    -1048             this.setHexValueIncludingUnusedBits(params);
    -1049         } else if (typeof params['hex'] != "undefined") {
    -1050             this.setHexValueIncludingUnusedBits(params['hex']);
    -1051         } else if (typeof params['bin'] != "undefined") {
    -1052             this.setByBinaryString(params['bin']);
    -1053         } else if (typeof params['array'] != "undefined") {
    -1054             this.setByBooleanArray(params['array']);
    -1055         }
    -1056     }
    -1057 };
    -1058 YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
    -1059 
    -1060 // ********************************************************************
    -1061 /**
    -1062  * class for ASN.1 DER OctetString<br/>
    -1063  * @name KJUR.asn1.DEROctetString
    -1064  * @class class for ASN.1 DER OctetString
    -1065  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1066  * @extends KJUR.asn1.DERAbstractString
    -1067  * @description
    -1068  * This class provides ASN.1 OctetString simple type.<br/>
    -1069  * Supported "params" attributes are:
    -1070  * <ul>
    -1071  * <li>str - to set a string as a value</li>
    -1072  * <li>hex - to set a hexadecimal string as a value</li>
    -1073  * <li>obj - to set a encapsulated ASN.1 value by JSON object 
    -1074  * which is defined in {@link KJUR.asn1.ASN1Util.newObject}</li>
    -1075  * </ul>
    -1076  * NOTE: A parameter 'obj' have been supported 
    -1077  * for "OCTET STRING, encapsulates" structure.
    -1078  * since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
    -1079  * @see KJUR.asn1.DERAbstractString - superclass
    -1080  * @example
    -1081  * // default constructor
    -1082  * o = new KJUR.asn1.DEROctetString();
    -1083  * // initialize with string
    -1084  * o = new KJUR.asn1.DEROctetString({str: "aaa"});
    -1085  * // initialize with hexadecimal string
    -1086  * o = new KJUR.asn1.DEROctetString({hex: "616161"});
    -1087  * // initialize with ASN1Util.newObject argument 
    -1088  * o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    -1089  * // above generates a ASN.1 data like this:
    -1090  * // OCTET STRING, encapsulates {
    -1091  * //   SEQUENCE {
    -1092  * //     INTEGER 3
    -1093  * //     PrintableString 'aaa'
    -1094  * //     }
    -1095  * //   } 
    -1096  */
    -1097 KJUR.asn1.DEROctetString = function(params) {
    -1098     if (params !== undefined && typeof params.obj !== "undefined") {
    -1099 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    -1100 	params.hex = o.getEncodedHex();
    -1101     }
    -1102     KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
    -1103     this.hT = "04";
    -1104 };
    -1105 YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
    -1106 
    -1107 // ********************************************************************
    -1108 /**
    -1109  * class for ASN.1 DER Null
    -1110  * @name KJUR.asn1.DERNull
    -1111  * @class class for ASN.1 DER Null
    -1112  * @extends KJUR.asn1.ASN1Object
    -1113  * @description
    -1114  * @see KJUR.asn1.ASN1Object - superclass
    -1115  */
    -1116 KJUR.asn1.DERNull = function() {
    -1117     KJUR.asn1.DERNull.superclass.constructor.call(this);
    -1118     this.hT = "05";
    -1119     this.hTLV = "0500";
    -1120 };
    -1121 YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
    -1122 
    -1123 // ********************************************************************
    -1124 /**
    -1125  * class for ASN.1 DER ObjectIdentifier
    -1126  * @name KJUR.asn1.DERObjectIdentifier
    -1127  * @class class for ASN.1 DER ObjectIdentifier
    -1128  * @param {Object} JSON object or string of parameters (ex. {'oid': '2.5.4.5'})
    -1129  * @extends KJUR.asn1.ASN1Object
    -1130  * @description
    -1131  * <br/>
    -1132  * As for argument 'params' for constructor, you can specify one of
    -1133  * following properties:
    -1134  * <ul>
    -1135  * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
    -1136  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1137  * </ul>
    -1138  * NOTE: 'params' can be omitted.
    -1139  * @example
    -1140  * new DERObjectIdentifier({"name": "sha1"})
    -1141  * new DERObjectIdentifier({"oid": "1.2.3.4"})
    -1142  * new DERObjectIdentifier({"hex": "2d..."})
    -1143  * new DERObjectIdentifier("1.2.3.4")
    -1144  * new DERObjectIdentifier("SHA1withRSA")
    -1145  */
    -1146 KJUR.asn1.DERObjectIdentifier = function(params) {
    -1147     var itox = function(i) {
    -1148         var h = i.toString(16);
    -1149         if (h.length == 1) h = '0' + h;
    -1150         return h;
    -1151     };
    -1152     var roidtox = function(roid) {
    -1153         var h = '';
    -1154         var bi = new BigInteger(roid, 10);
    -1155         var b = bi.toString(2);
    -1156         var padLen = 7 - b.length % 7;
    -1157         if (padLen == 7) padLen = 0;
    -1158         var bPad = '';
    -1159         for (var i = 0; i < padLen; i++) bPad += '0';
    -1160         b = bPad + b;
    -1161         for (var i = 0; i < b.length - 1; i += 7) {
    -1162             var b8 = b.substr(i, 7);
    -1163             if (i != b.length - 7) b8 = '1' + b8;
    -1164             h += itox(parseInt(b8, 2));
    -1165         }
    -1166         return h;
    -1167     }
    -1168 
    -1169     KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
    -1170     this.hT = "06";
    -1171 
    -1172     /**
    -1173      * set value by a hexadecimal string
    -1174      * @name setValueHex
    -1175      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1176      * @function
    -1177      * @param {String} newHexString hexadecimal value of OID bytes
    -1178      */
    -1179     this.setValueHex = function(newHexString) {
    -1180         this.hTLV = null;
    -1181         this.isModified = true;
    -1182         this.s = null;
    -1183         this.hV = newHexString;
    -1184     };
    -1185 
    -1186     /**
    -1187      * set value by a OID string<br/>
    -1188      * @name setValueOidString
    -1189      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1190      * @function
    -1191      * @param {String} oidString OID string (ex. 2.5.4.13)
    -1192      * @example
    -1193      * o = new KJUR.asn1.DERObjectIdentifier();
    -1194      * o.setValueOidString("2.5.4.13");
    -1195      */
    -1196     this.setValueOidString = function(oidString) {
    -1197         if (! oidString.match(/^[0-9.]+$/)) {
    -1198             throw new Error("malformed oid string: " + oidString);
    -1199         }
    -1200         var h = '';
    -1201         var a = oidString.split('.');
    -1202         var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
    -1203         h += itox(i0);
    -1204         a.splice(0, 2);
    -1205         for (var i = 0; i < a.length; i++) {
    -1206             h += roidtox(a[i]);
    +793  * @see KJUR.asn1.ASN1Object - superclass
    +794  * @description
    +795  * In ASN.1 DER, DER Boolean "false" shall be omitted.
    +796  * However this supports boolean false for future BER support.
    +797  * @example
    +798  * new KJUR.asn1.DERBoolean(true)
    +799  * new KJUR.asn1.DERBoolean(false)
    +800  */
    +801 KJUR.asn1.DERBoolean = function(params) {
    +802     KJUR.asn1.DERBoolean.superclass.constructor.call(this);
    +803     this.hT = "01";
    +804     if (params == false)
    +805 	this.hTLV = "010100";
    +806     else 
    +807 	this.hTLV = "0101ff";
    +808 };
    +809 YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
    +810 
    +811 // ********************************************************************
    +812 /**
    +813  * class for ASN.1 DER Integer
    +814  * @name KJUR.asn1.DERInteger
    +815  * @class class for ASN.1 DER Integer
    +816  * @extends KJUR.asn1.ASN1Object
    +817  * @description
    +818  * <br/>
    +819  * As for argument 'params' for constructor, you can specify one of
    +820  * following properties:
    +821  * <ul>
    +822  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    +823  * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
    +824  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +825  * </ul>
    +826  * NOTE: 'params' can be omitted.
    +827  */
    +828 KJUR.asn1.DERInteger = function(params) {
    +829     KJUR.asn1.DERInteger.superclass.constructor.call(this);
    +830     this.hT = "02";
    +831 
    +832     /**
    +833      * set value by Tom Wu's BigInteger object
    +834      * @name setByBigInteger
    +835      * @memberOf KJUR.asn1.DERInteger#
    +836      * @function
    +837      * @param {BigInteger} bigIntegerValue to set
    +838      */
    +839     this.setByBigInteger = function(bigIntegerValue) {
    +840         this.hTLV = null;
    +841         this.isModified = true;
    +842         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    +843     };
    +844 
    +845     /**
    +846      * set value by integer value
    +847      * @name setByInteger
    +848      * @memberOf KJUR.asn1.DERInteger
    +849      * @function
    +850      * @param {Integer} integer value to set
    +851      */
    +852     this.setByInteger = function(intValue) {
    +853         var bi = new BigInteger(String(intValue), 10);
    +854         this.setByBigInteger(bi);
    +855     };
    +856 
    +857     /**
    +858      * set value by integer value
    +859      * @name setValueHex
    +860      * @memberOf KJUR.asn1.DERInteger#
    +861      * @function
    +862      * @param {String} hexadecimal string of integer value
    +863      * @description
    +864      * <br/>
    +865      * NOTE: Value shall be represented by minimum octet length of
    +866      * two's complement representation.
    +867      * @example
    +868      * new KJUR.asn1.DERInteger(123);
    +869      * new KJUR.asn1.DERInteger({'int': 123});
    +870      * new KJUR.asn1.DERInteger({'hex': '1fad'});
    +871      */
    +872     this.setValueHex = function(newHexString) {
    +873         this.hV = newHexString;
    +874     };
    +875 
    +876     this.getFreshValueHex = function() {
    +877         return this.hV;
    +878     };
    +879 
    +880     if (typeof params != "undefined") {
    +881         if (typeof params['bigint'] != "undefined") {
    +882             this.setByBigInteger(params['bigint']);
    +883         } else if (typeof params['int'] != "undefined") {
    +884             this.setByInteger(params['int']);
    +885         } else if (typeof params == "number") {
    +886             this.setByInteger(params);
    +887         } else if (typeof params['hex'] != "undefined") {
    +888             this.setValueHex(params['hex']);
    +889         }
    +890     }
    +891 };
    +892 YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
    +893 
    +894 // ********************************************************************
    +895 /**
    +896  * class for ASN.1 DER encoded BitString primitive
    +897  * @name KJUR.asn1.DERBitString
    +898  * @class class for ASN.1 DER encoded BitString primitive
    +899  * @extends KJUR.asn1.ASN1Object
    +900  * @description 
    +901  * <br/>
    +902  * As for argument 'params' for constructor, you can specify one of
    +903  * following properties:
    +904  * <ul>
    +905  * <li>bin - specify binary string (ex. '10111')</li>
    +906  * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
    +907  * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
    +908  * <li>obj - specify {@link KJUR.asn1.ASN1Util.newObject} 
    +909  * argument for "BitString encapsulates" structure.</li>
    +910  * </ul>
    +911  * NOTE1: 'params' can be omitted.<br/>
    +912  * NOTE2: 'obj' parameter have been supported since
    +913  * asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).<br/>
    +914  * @example
    +915  * // default constructor
    +916  * o = new KJUR.asn1.DERBitString();
    +917  * // initialize with binary string
    +918  * o = new KJUR.asn1.DERBitString({bin: "1011"});
    +919  * // initialize with boolean array
    +920  * o = new KJUR.asn1.DERBitString({array: [true,false,true,true]});
    +921  * // initialize with hexadecimal string (04 is unused bits)
    +922  * o = new KJUR.asn1.DEROctetString({hex: "04bac0"});
    +923  * // initialize with ASN1Util.newObject argument for encapsulated
    +924  * o = new KJUR.asn1.DERBitString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    +925  * // above generates a ASN.1 data like this:
    +926  * // BIT STRING, encapsulates {
    +927  * //   SEQUENCE {
    +928  * //     INTEGER 3
    +929  * //     PrintableString 'aaa'
    +930  * //     }
    +931  * //   } 
    +932  */
    +933 KJUR.asn1.DERBitString = function(params) {
    +934     if (params !== undefined && typeof params.obj !== "undefined") {
    +935 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    +936 	params.hex = "00" + o.getEncodedHex();
    +937     }
    +938     KJUR.asn1.DERBitString.superclass.constructor.call(this);
    +939     this.hT = "03";
    +940 
    +941     /**
    +942      * set ASN.1 value(V) by a hexadecimal string including unused bits
    +943      * @name setHexValueIncludingUnusedBits
    +944      * @memberOf KJUR.asn1.DERBitString#
    +945      * @function
    +946      * @param {String} newHexStringIncludingUnusedBits
    +947      */
    +948     this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
    +949         this.hTLV = null;
    +950         this.isModified = true;
    +951         this.hV = newHexStringIncludingUnusedBits;
    +952     };
    +953 
    +954     /**
    +955      * set ASN.1 value(V) by unused bit and hexadecimal string of value
    +956      * @name setUnusedBitsAndHexValue
    +957      * @memberOf KJUR.asn1.DERBitString#
    +958      * @function
    +959      * @param {Integer} unusedBits
    +960      * @param {String} hValue
    +961      */
    +962     this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
    +963         if (unusedBits < 0 || 7 < unusedBits) {
    +964             throw "unused bits shall be from 0 to 7: u = " + unusedBits;
    +965         }
    +966         var hUnusedBits = "0" + unusedBits;
    +967         this.hTLV = null;
    +968         this.isModified = true;
    +969         this.hV = hUnusedBits + hValue;
    +970     };
    +971 
    +972     /**
    +973      * set ASN.1 DER BitString by binary string<br/>
    +974      * @name setByBinaryString
    +975      * @memberOf KJUR.asn1.DERBitString#
    +976      * @function
    +977      * @param {String} binaryString binary value string (i.e. '10111')
    +978      * @description
    +979      * Its unused bits will be calculated automatically by length of 
    +980      * 'binaryValue'. <br/>
    +981      * NOTE: Trailing zeros '0' will be ignored.
    +982      * @example
    +983      * o = new KJUR.asn1.DERBitString();
    +984      * o.setByBooleanArray("01011");
    +985      */
    +986     this.setByBinaryString = function(binaryString) {
    +987         binaryString = binaryString.replace(/0+$/, '');
    +988         var unusedBits = 8 - binaryString.length % 8;
    +989         if (unusedBits == 8) unusedBits = 0;
    +990         for (var i = 0; i <= unusedBits; i++) {
    +991             binaryString += '0';
    +992         }
    +993         var h = '';
    +994         for (var i = 0; i < binaryString.length - 1; i += 8) {
    +995             var b = binaryString.substr(i, 8);
    +996             var x = parseInt(b, 2).toString(16);
    +997             if (x.length == 1) x = '0' + x;
    +998             h += x;  
    +999         }
    +1000         this.hTLV = null;
    +1001         this.isModified = true;
    +1002         this.hV = '0' + unusedBits + h;
    +1003     };
    +1004 
    +1005     /**
    +1006      * set ASN.1 TLV value(V) by an array of boolean<br/>
    +1007      * @name setByBooleanArray
    +1008      * @memberOf KJUR.asn1.DERBitString#
    +1009      * @function
    +1010      * @param {array} booleanArray array of boolean (ex. [true, false, true])
    +1011      * @description
    +1012      * NOTE: Trailing falses will be ignored in the ASN.1 DER Object.
    +1013      * @example
    +1014      * o = new KJUR.asn1.DERBitString();
    +1015      * o.setByBooleanArray([false, true, false, true, true]);
    +1016      */
    +1017     this.setByBooleanArray = function(booleanArray) {
    +1018         var s = '';
    +1019         for (var i = 0; i < booleanArray.length; i++) {
    +1020             if (booleanArray[i] == true) {
    +1021                 s += '1';
    +1022             } else {
    +1023                 s += '0';
    +1024             }
    +1025         }
    +1026         this.setByBinaryString(s);
    +1027     };
    +1028 
    +1029     /**
    +1030      * generate an array of falses with specified length<br/>
    +1031      * @name newFalseArray
    +1032      * @memberOf KJUR.asn1.DERBitString
    +1033      * @function
    +1034      * @param {Integer} nLength length of array to generate
    +1035      * @return {array} array of boolean falses
    +1036      * @description
    +1037      * This static method may be useful to initialize boolean array.
    +1038      * @example
    +1039      * o = new KJUR.asn1.DERBitString();
    +1040      * o.newFalseArray(3) → [false, false, false]
    +1041      */
    +1042     this.newFalseArray = function(nLength) {
    +1043         var a = new Array(nLength);
    +1044         for (var i = 0; i < nLength; i++) {
    +1045             a[i] = false;
    +1046         }
    +1047         return a;
    +1048     };
    +1049 
    +1050     this.getFreshValueHex = function() {
    +1051         return this.hV;
    +1052     };
    +1053 
    +1054     if (typeof params != "undefined") {
    +1055         if (typeof params == "string" && params.toLowerCase().match(/^[0-9a-f]+$/)) {
    +1056             this.setHexValueIncludingUnusedBits(params);
    +1057         } else if (typeof params['hex'] != "undefined") {
    +1058             this.setHexValueIncludingUnusedBits(params['hex']);
    +1059         } else if (typeof params['bin'] != "undefined") {
    +1060             this.setByBinaryString(params['bin']);
    +1061         } else if (typeof params['array'] != "undefined") {
    +1062             this.setByBooleanArray(params['array']);
    +1063         }
    +1064     }
    +1065 };
    +1066 YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
    +1067 
    +1068 // ********************************************************************
    +1069 /**
    +1070  * class for ASN.1 DER OctetString<br/>
    +1071  * @name KJUR.asn1.DEROctetString
    +1072  * @class class for ASN.1 DER OctetString
    +1073  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1074  * @extends KJUR.asn1.DERAbstractString
    +1075  * @description
    +1076  * This class provides ASN.1 OctetString simple type.<br/>
    +1077  * Supported "params" attributes are:
    +1078  * <ul>
    +1079  * <li>str - to set a string as a value</li>
    +1080  * <li>hex - to set a hexadecimal string as a value</li>
    +1081  * <li>obj - to set a encapsulated ASN.1 value by JSON object 
    +1082  * which is defined in {@link KJUR.asn1.ASN1Util.newObject}</li>
    +1083  * </ul>
    +1084  * NOTE: A parameter 'obj' have been supported 
    +1085  * for "OCTET STRING, encapsulates" structure.
    +1086  * since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
    +1087  * @see KJUR.asn1.DERAbstractString - superclass
    +1088  * @example
    +1089  * // default constructor
    +1090  * o = new KJUR.asn1.DEROctetString();
    +1091  * // initialize with string
    +1092  * o = new KJUR.asn1.DEROctetString({str: "aaa"});
    +1093  * // initialize with hexadecimal string
    +1094  * o = new KJUR.asn1.DEROctetString({hex: "616161"});
    +1095  * // initialize with ASN1Util.newObject argument 
    +1096  * o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    +1097  * // above generates a ASN.1 data like this:
    +1098  * // OCTET STRING, encapsulates {
    +1099  * //   SEQUENCE {
    +1100  * //     INTEGER 3
    +1101  * //     PrintableString 'aaa'
    +1102  * //     }
    +1103  * //   } 
    +1104  */
    +1105 KJUR.asn1.DEROctetString = function(params) {
    +1106     if (params !== undefined && typeof params.obj !== "undefined") {
    +1107 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    +1108 	params.hex = o.getEncodedHex();
    +1109     }
    +1110     KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
    +1111     this.hT = "04";
    +1112 };
    +1113 YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
    +1114 
    +1115 // ********************************************************************
    +1116 /**
    +1117  * class for ASN.1 DER Null
    +1118  * @name KJUR.asn1.DERNull
    +1119  * @class class for ASN.1 DER Null
    +1120  * @extends KJUR.asn1.ASN1Object
    +1121  * @description
    +1122  * @see KJUR.asn1.ASN1Object - superclass
    +1123  */
    +1124 KJUR.asn1.DERNull = function() {
    +1125     KJUR.asn1.DERNull.superclass.constructor.call(this);
    +1126     this.hT = "05";
    +1127     this.hTLV = "0500";
    +1128 };
    +1129 YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
    +1130 
    +1131 // ********************************************************************
    +1132 /**
    +1133  * class for ASN.1 DER ObjectIdentifier
    +1134  * @name KJUR.asn1.DERObjectIdentifier
    +1135  * @class class for ASN.1 DER ObjectIdentifier
    +1136  * @param {Object} JSON object or string of parameters (ex. {'oid': '2.5.4.5'})
    +1137  * @extends KJUR.asn1.ASN1Object
    +1138  * @description
    +1139  * <br/>
    +1140  * As for argument 'params' for constructor, you can specify one of
    +1141  * following properties:
    +1142  * <ul>
    +1143  * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
    +1144  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +1145  * </ul>
    +1146  * NOTE: 'params' can be omitted.
    +1147  * @example
    +1148  * new DERObjectIdentifier({"name": "sha1"})
    +1149  * new DERObjectIdentifier({"oid": "1.2.3.4"})
    +1150  * new DERObjectIdentifier({"hex": "2d..."})
    +1151  * new DERObjectIdentifier("1.2.3.4")
    +1152  * new DERObjectIdentifier("SHA1withRSA")
    +1153  */
    +1154 KJUR.asn1.DERObjectIdentifier = function(params) {
    +1155     var itox = function(i) {
    +1156         var h = i.toString(16);
    +1157         if (h.length == 1) h = '0' + h;
    +1158         return h;
    +1159     };
    +1160     var roidtox = function(roid) {
    +1161         var h = '';
    +1162         var bi = new BigInteger(roid, 10);
    +1163         var b = bi.toString(2);
    +1164         var padLen = 7 - b.length % 7;
    +1165         if (padLen == 7) padLen = 0;
    +1166         var bPad = '';
    +1167         for (var i = 0; i < padLen; i++) bPad += '0';
    +1168         b = bPad + b;
    +1169         for (var i = 0; i < b.length - 1; i += 7) {
    +1170             var b8 = b.substr(i, 7);
    +1171             if (i != b.length - 7) b8 = '1' + b8;
    +1172             h += itox(parseInt(b8, 2));
    +1173         }
    +1174         return h;
    +1175     }
    +1176 
    +1177     KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
    +1178     this.hT = "06";
    +1179 
    +1180     /**
    +1181      * set value by a hexadecimal string
    +1182      * @name setValueHex
    +1183      * @memberOf KJUR.asn1.DERObjectIdentifier#
    +1184      * @function
    +1185      * @param {String} newHexString hexadecimal value of OID bytes
    +1186      */
    +1187     this.setValueHex = function(newHexString) {
    +1188         this.hTLV = null;
    +1189         this.isModified = true;
    +1190         this.s = null;
    +1191         this.hV = newHexString;
    +1192     };
    +1193 
    +1194     /**
    +1195      * set value by a OID string<br/>
    +1196      * @name setValueOidString
    +1197      * @memberOf KJUR.asn1.DERObjectIdentifier#
    +1198      * @function
    +1199      * @param {String} oidString OID string (ex. 2.5.4.13)
    +1200      * @example
    +1201      * o = new KJUR.asn1.DERObjectIdentifier();
    +1202      * o.setValueOidString("2.5.4.13");
    +1203      */
    +1204     this.setValueOidString = function(oidString) {
    +1205         if (! oidString.match(/^[0-9.]+$/)) {
    +1206             throw new Error("malformed oid string: " + oidString);
     1207         }
    -1208         this.hTLV = null;
    -1209         this.isModified = true;
    -1210         this.s = null;
    -1211         this.hV = h;
    -1212     };
    -1213 
    -1214     /**
    -1215      * set value by a OID name
    -1216      * @name setValueName
    -1217      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1218      * @function
    -1219      * @param {String} oidName OID name (ex. 'serverAuth')
    -1220      * @since 1.0.1
    -1221      * @description
    -1222      * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.
    -1223      * Otherwise raise error.
    -1224      * @example
    -1225      * o = new KJUR.asn1.DERObjectIdentifier();
    -1226      * o.setValueName("serverAuth");
    -1227      */
    -1228     this.setValueName = function(oidName) {
    -1229 	var oid = KJUR.asn1.x509.OID.name2oid(oidName);
    -1230 	if (oid !== '') {
    -1231             this.setValueOidString(oid);
    -1232         } else {
    -1233             throw new Error("DERObjectIdentifier oidName undefined: " + oidName);
    -1234         }
    -1235     };
    -1236 
    -1237     this.setValueNameOrOid = function(nameOrOid) {
    -1238 	if (nameOrOid.match(/^[0-2].[0-9.]+$/)) {
    -1239 	    this.setValueOidString(nameOrOid);
    -1240 	} else {
    -1241 	    this.setValueName(nameOrOid);
    -1242 	}
    -1243     }
    +1208         var h = '';
    +1209         var a = oidString.split('.');
    +1210         var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
    +1211         h += itox(i0);
    +1212         a.splice(0, 2);
    +1213         for (var i = 0; i < a.length; i++) {
    +1214             h += roidtox(a[i]);
    +1215         }
    +1216         this.hTLV = null;
    +1217         this.isModified = true;
    +1218         this.s = null;
    +1219         this.hV = h;
    +1220     };
    +1221 
    +1222     /**
    +1223      * set value by a OID name
    +1224      * @name setValueName
    +1225      * @memberOf KJUR.asn1.DERObjectIdentifier#
    +1226      * @function
    +1227      * @param {String} oidName OID name (ex. 'serverAuth')
    +1228      * @since 1.0.1
    +1229      * @description
    +1230      * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.
    +1231      * Otherwise raise error.
    +1232      * @example
    +1233      * o = new KJUR.asn1.DERObjectIdentifier();
    +1234      * o.setValueName("serverAuth");
    +1235      */
    +1236     this.setValueName = function(oidName) {
    +1237 	var oid = KJUR.asn1.x509.OID.name2oid(oidName);
    +1238 	if (oid !== '') {
    +1239             this.setValueOidString(oid);
    +1240         } else {
    +1241             throw new Error("DERObjectIdentifier oidName undefined: " + oidName);
    +1242         }
    +1243     };
     1244 
    -1245     this.getFreshValueHex = function() {
    -1246         return this.hV;
    -1247     };
    -1248 
    -1249     this.setByParam = function(params) {
    -1250         if (typeof params === "string") {
    -1251 	    this.setValueNameOrOid(params);
    -1252         } else if (params.oid !== undefined) {
    -1253 	    this.setValueNameOrOid(params.oid);
    -1254         } else if (params.name !== undefined) {
    -1255             this.setValueNameOrOid(params.name);
    -1256         } else if (params.hex !== undefined) {
    -1257             this.setValueHex(params.hex);
    -1258         }
    -1259     };
    -1260 
    -1261     if (params !== undefined) this.setByParam(params);
    -1262 };
    -1263 YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);
    -1264 
    -1265 // ********************************************************************
    -1266 /**
    -1267  * class for ASN.1 DER Enumerated
    -1268  * @name KJUR.asn1.DEREnumerated
    -1269  * @class class for ASN.1 DER Enumerated
    -1270  * @extends KJUR.asn1.ASN1Object
    -1271  * @description
    -1272  * <br/>
    -1273  * As for argument 'params' for constructor, you can specify one of
    -1274  * following properties:
    -1275  * <ul>
    -1276  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    -1277  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1278  * </ul>
    -1279  * NOTE: 'params' can be omitted.
    -1280  * @example
    -1281  * new KJUR.asn1.DEREnumerated(123);
    -1282  * new KJUR.asn1.DEREnumerated({int: 123});
    -1283  * new KJUR.asn1.DEREnumerated({hex: '1fad'});
    -1284  */
    -1285 KJUR.asn1.DEREnumerated = function(params) {
    -1286     KJUR.asn1.DEREnumerated.superclass.constructor.call(this);
    -1287     this.hT = "0a";
    -1288 
    -1289     /**
    -1290      * set value by Tom Wu's BigInteger object
    -1291      * @name setByBigInteger
    -1292      * @memberOf KJUR.asn1.DEREnumerated#
    -1293      * @function
    -1294      * @param {BigInteger} bigIntegerValue to set
    -1295      */
    -1296     this.setByBigInteger = function(bigIntegerValue) {
    -1297         this.hTLV = null;
    -1298         this.isModified = true;
    -1299         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    -1300     };
    -1301 
    -1302     /**
    -1303      * set value by integer value
    -1304      * @name setByInteger
    -1305      * @memberOf KJUR.asn1.DEREnumerated#
    -1306      * @function
    -1307      * @param {Integer} integer value to set
    -1308      */
    -1309     this.setByInteger = function(intValue) {
    -1310         var bi = new BigInteger(String(intValue), 10);
    -1311         this.setByBigInteger(bi);
    -1312     };
    -1313 
    -1314     /**
    -1315      * set value by integer value
    -1316      * @name setValueHex
    -1317      * @memberOf KJUR.asn1.DEREnumerated#
    -1318      * @function
    -1319      * @param {String} hexadecimal string of integer value
    -1320      * @description
    -1321      * <br/>
    -1322      * NOTE: Value shall be represented by minimum octet length of
    -1323      * two's complement representation.
    -1324      */
    -1325     this.setValueHex = function(newHexString) {
    -1326         this.hV = newHexString;
    -1327     };
    -1328 
    -1329     this.getFreshValueHex = function() {
    -1330         return this.hV;
    -1331     };
    -1332 
    -1333     if (typeof params != "undefined") {
    -1334         if (typeof params['int'] != "undefined") {
    -1335             this.setByInteger(params['int']);
    -1336         } else if (typeof params == "number") {
    -1337             this.setByInteger(params);
    -1338         } else if (typeof params['hex'] != "undefined") {
    -1339             this.setValueHex(params['hex']);
    -1340         }
    -1341     }
    -1342 };
    -1343 YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object);
    -1344 
    -1345 // ********************************************************************
    -1346 /**
    -1347  * class for ASN.1 DER UTF8String
    -1348  * @name KJUR.asn1.DERUTF8String
    -1349  * @class class for ASN.1 DER UTF8String
    -1350  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1351  * @extends KJUR.asn1.DERAbstractString
    -1352  * @description
    -1353  * @see KJUR.asn1.DERAbstractString - superclass
    -1354  */
    -1355 KJUR.asn1.DERUTF8String = function(params) {
    -1356     KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);
    -1357     this.hT = "0c";
    -1358 };
    -1359 YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);
    -1360 
    -1361 // ********************************************************************
    -1362 /**
    -1363  * class for ASN.1 DER NumericString
    -1364  * @name KJUR.asn1.DERNumericString
    -1365  * @class class for ASN.1 DER NumericString
    -1366  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1367  * @extends KJUR.asn1.DERAbstractString
    -1368  * @description
    -1369  * @see KJUR.asn1.DERAbstractString - superclass
    -1370  */
    -1371 KJUR.asn1.DERNumericString = function(params) {
    -1372     KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);
    -1373     this.hT = "12";
    -1374 };
    -1375 YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);
    -1376 
    -1377 // ********************************************************************
    -1378 /**
    -1379  * class for ASN.1 DER PrintableString
    -1380  * @name KJUR.asn1.DERPrintableString
    -1381  * @class class for ASN.1 DER PrintableString
    -1382  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1383  * @extends KJUR.asn1.DERAbstractString
    -1384  * @description
    -1385  * @see KJUR.asn1.DERAbstractString - superclass
    -1386  */
    -1387 KJUR.asn1.DERPrintableString = function(params) {
    -1388     KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);
    -1389     this.hT = "13";
    -1390 };
    -1391 YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);
    -1392 
    -1393 // ********************************************************************
    -1394 /**
    -1395  * class for ASN.1 DER TeletexString
    -1396  * @name KJUR.asn1.DERTeletexString
    -1397  * @class class for ASN.1 DER TeletexString
    -1398  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1399  * @extends KJUR.asn1.DERAbstractString
    -1400  * @description
    -1401  * @see KJUR.asn1.DERAbstractString - superclass
    -1402  */
    -1403 KJUR.asn1.DERTeletexString = function(params) {
    -1404     KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);
    -1405     this.hT = "14";
    -1406 };
    -1407 YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);
    -1408 
    -1409 // ********************************************************************
    -1410 /**
    -1411  * class for ASN.1 DER IA5String
    -1412  * @name KJUR.asn1.DERIA5String
    -1413  * @class class for ASN.1 DER IA5String
    -1414  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1415  * @extends KJUR.asn1.DERAbstractString
    -1416  * @description
    -1417  * @see KJUR.asn1.DERAbstractString - superclass
    -1418  */
    -1419 KJUR.asn1.DERIA5String = function(params) {
    -1420     KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
    -1421     this.hT = "16";
    -1422 };
    -1423 YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);
    -1424 
    -1425 // ********************************************************************
    -1426 /**
    -1427  * class for ASN.1 DER VisibleString
    -1428  * @name KJUR.asn1.DERVisibleString
    -1429  * @class class for ASN.1 DER VisibleString
    -1430  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1431  * @extends KJUR.asn1.DERAbstractString
    -1432  * @since jsrsasign 8.0.23 asn1 1.0.15
    -1433  * @description
    -1434  * @see KJUR.asn1.DERAbstractString - superclass
    -1435  */
    -1436 KJUR.asn1.DERVisibleString = function(params) {
    -1437     KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
    -1438     this.hT = "1a";
    -1439 };
    -1440 YAHOO.lang.extend(KJUR.asn1.DERVisibleString, KJUR.asn1.DERAbstractString);
    -1441 
    -1442 // ********************************************************************
    -1443 /**
    -1444  * class for ASN.1 DER BMPString
    -1445  * @name KJUR.asn1.DERBMPString
    -1446  * @class class for ASN.1 DER BMPString
    -1447  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1448  * @extends KJUR.asn1.DERAbstractString
    -1449  * @since jsrsasign 8.0.23 asn1 1.0.15
    -1450  * @description
    -1451  * @see KJUR.asn1.DERAbstractString - superclass
    -1452  */
    -1453 KJUR.asn1.DERBMPString = function(params) {
    -1454     KJUR.asn1.DERBMPString.superclass.constructor.call(this, params);
    -1455     this.hT = "1e";
    -1456 };
    -1457 YAHOO.lang.extend(KJUR.asn1.DERBMPString, KJUR.asn1.DERAbstractString);
    -1458 
    -1459 // ********************************************************************
    -1460 /**
    -1461  * class for ASN.1 DER UTCTime
    -1462  * @name KJUR.asn1.DERUTCTime
    -1463  * @class class for ASN.1 DER UTCTime
    -1464  * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
    -1465  * @extends KJUR.asn1.DERAbstractTime
    -1466  * @description
    -1467  * <br/>
    -1468  * As for argument 'params' for constructor, you can specify one of
    -1469  * following properties:
    -1470  * <ul>
    -1471  * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
    -1472  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1473  * <li>date - specify Date object.</li>
    -1474  * </ul>
    -1475  * NOTE: 'params' can be omitted.
    -1476  * <h4>EXAMPLES</h4>
    -1477  * @example
    -1478  * d1 = new KJUR.asn1.DERUTCTime();
    -1479  * d1.setString('130430125959Z');
    -1480  *
    -1481  * d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
    -1482  * d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
    -1483  * d4 = new KJUR.asn1.DERUTCTime('130430125959Z');
    -1484  */
    -1485 KJUR.asn1.DERUTCTime = function(params) {
    -1486     KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);
    -1487     this.hT = "17";
    -1488 
    -1489     /**
    -1490      * set value by a Date object<br/>
    -1491      * @name setByDate
    -1492      * @memberOf KJUR.asn1.DERUTCTime#
    -1493      * @function
    -1494      * @param {Date} dateObject Date object to set ASN.1 value(V)
    -1495      * @example
    -1496      * o = new KJUR.asn1.DERUTCTime();
    -1497      * o.setByDate(new Date("2016/12/31"));
    -1498      */
    -1499     this.setByDate = function(dateObject) {
    -1500         this.hTLV = null;
    -1501         this.isModified = true;
    -1502         this.date = dateObject;
    -1503         this.s = this.formatDate(this.date, 'utc');
    -1504         this.hV = stohex(this.s);
    -1505     };
    -1506 
    -1507     this.getFreshValueHex = function() {
    -1508         if (typeof this.date == "undefined" && typeof this.s == "undefined") {
    -1509             this.date = new Date();
    -1510             this.s = this.formatDate(this.date, 'utc');
    -1511             this.hV = stohex(this.s);
    -1512         }
    -1513         return this.hV;
    -1514     };
    -1515 
    -1516     if (params !== undefined) {
    -1517         if (params.str !== undefined) {
    -1518             this.setString(params.str);
    -1519         } else if (typeof params == "string" && params.match(/^[0-9]{12}Z$/)) {
    -1520             this.setString(params);
    -1521         } else if (params.hex !== undefined) {
    -1522             this.setStringHex(params.hex);
    -1523         } else if (params.date !== undefined) {
    -1524             this.setByDate(params.date);
    -1525         }
    -1526     }
    -1527 };
    -1528 YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);
    -1529 
    -1530 // ********************************************************************
    -1531 /**
    -1532  * class for ASN.1 DER GeneralizedTime
    -1533  * @name KJUR.asn1.DERGeneralizedTime
    -1534  * @class class for ASN.1 DER GeneralizedTime
    -1535  * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
    -1536  * @property {Boolean} withMillis flag to show milliseconds or not
    -1537  * @extends KJUR.asn1.DERAbstractTime
    -1538  * @description
    -1539  * <br/>
    -1540  * As for argument 'params' for constructor, you can specify one of
    -1541  * following properties:
    -1542  * <ul>
    -1543  * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
    -1544  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1545  * <li>date - specify Date object.</li>
    -1546  * <li>millis - specify flag to show milliseconds (from 1.0.6)</li>
    -1547  * </ul>
    -1548  * NOTE1: 'params' can be omitted.
    -1549  * NOTE2: 'withMillis' property is supported from asn1 1.0.6.
    -1550  */
    -1551 KJUR.asn1.DERGeneralizedTime = function(params) {
    -1552     KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);
    -1553     this.hT = "18";
    -1554     this.withMillis = false;
    -1555 
    -1556     /**
    -1557      * set value by a Date object
    -1558      * @name setByDate
    -1559      * @memberOf KJUR.asn1.DERGeneralizedTime#
    -1560      * @function
    -1561      * @param {Date} dateObject Date object to set ASN.1 value(V)
    -1562      * @example
    -1563      * When you specify UTC time, use 'Date.UTC' method like this:<br/>
    -1564      * o1 = new DERUTCTime();
    -1565      * o1.setByDate(date);
    -1566      *
    -1567      * date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59
    -1568      */
    -1569     this.setByDate = function(dateObject) {
    -1570         this.hTLV = null;
    -1571         this.isModified = true;
    -1572         this.date = dateObject;
    -1573         this.s = this.formatDate(this.date, 'gen', this.withMillis);
    -1574         this.hV = stohex(this.s);
    -1575     };
    -1576 
    -1577     this.getFreshValueHex = function() {
    -1578         if (this.date === undefined && this.s === undefined) {
    -1579             this.date = new Date();
    -1580             this.s = this.formatDate(this.date, 'gen', this.withMillis);
    -1581             this.hV = stohex(this.s);
    -1582         }
    -1583         return this.hV;
    -1584     };
    -1585 
    -1586     if (params !== undefined) {
    -1587         if (params.str !== undefined) {
    -1588             this.setString(params.str);
    -1589         } else if (typeof params == "string" && params.match(/^[0-9]{14}Z$/)) {
    -1590             this.setString(params);
    -1591         } else if (params.hex !== undefined) {
    -1592             this.setStringHex(params.hex);
    -1593         } else if (params.date !== undefined) {
    -1594             this.setByDate(params.date);
    -1595         }
    -1596         if (params.millis === true) {
    -1597             this.withMillis = true;
    -1598         }
    -1599     }
    -1600 };
    -1601 YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);
    -1602 
    -1603 // ********************************************************************
    -1604 /**
    -1605  * class for ASN.1 DER Sequence
    -1606  * @name KJUR.asn1.DERSequence
    -1607  * @class class for ASN.1 DER Sequence
    -1608  * @extends KJUR.asn1.DERAbstractStructured
    -1609  * @description
    -1610  * <br/>
    -1611  * As for argument 'params' for constructor, you can specify one of
    -1612  * following properties:
    -1613  * <ul>
    -1614  * <li>array - specify array of ASN1Object to set elements of content</li>
    -1615  * </ul>
    -1616  * NOTE: 'params' can be omitted.
    -1617  */
    -1618 KJUR.asn1.DERSequence = function(params) {
    -1619     KJUR.asn1.DERSequence.superclass.constructor.call(this, params);
    -1620     this.hT = "30";
    -1621     this.getFreshValueHex = function() {
    -1622         var h = '';
    -1623         for (var i = 0; i < this.asn1Array.length; i++) {
    -1624             var asn1Obj = this.asn1Array[i];
    -1625             h += asn1Obj.getEncodedHex();
    -1626         }
    -1627         this.hV = h;
    -1628         return this.hV;
    -1629     };
    -1630 };
    -1631 YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);
    -1632 
    -1633 // ********************************************************************
    -1634 /**
    -1635  * class for ASN.1 DER Set
    -1636  * @name KJUR.asn1.DERSet
    -1637  * @class class for ASN.1 DER Set
    -1638  * @extends KJUR.asn1.DERAbstractStructured
    -1639  * @description
    -1640  * <br/>
    -1641  * As for argument 'params' for constructor, you can specify one of
    -1642  * following properties:
    -1643  * <ul>
    -1644  * <li>array - specify array of ASN1Object to set elements of content</li>
    -1645  * <li>sortflag - flag for sort (default: true). ASN.1 BER is not sorted in 'SET OF'.</li>
    -1646  * </ul>
    -1647  * NOTE1: 'params' can be omitted.<br/>
    -1648  * NOTE2: sortflag is supported since 1.0.5.
    -1649  */
    -1650 KJUR.asn1.DERSet = function(params) {
    -1651     KJUR.asn1.DERSet.superclass.constructor.call(this, params);
    -1652     this.hT = "31";
    -1653     this.sortFlag = true; // item shall be sorted only in ASN.1 DER
    -1654     this.getFreshValueHex = function() {
    -1655         var a = new Array();
    -1656         for (var i = 0; i < this.asn1Array.length; i++) {
    -1657             var asn1Obj = this.asn1Array[i];
    -1658             a.push(asn1Obj.getEncodedHex());
    -1659         }
    -1660         if (this.sortFlag == true) a.sort();
    -1661         this.hV = a.join('');
    -1662         return this.hV;
    -1663     };
    -1664 
    -1665     if (typeof params != "undefined") {
    -1666         if (typeof params.sortflag != "undefined" &&
    -1667             params.sortflag == false)
    -1668             this.sortFlag = false;
    -1669     }
    -1670 };
    -1671 YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);
    +1245     this.setValueNameOrOid = function(nameOrOid) {
    +1246 	if (nameOrOid.match(/^[0-2].[0-9.]+$/)) {
    +1247 	    this.setValueOidString(nameOrOid);
    +1248 	} else {
    +1249 	    this.setValueName(nameOrOid);
    +1250 	}
    +1251     }
    +1252 
    +1253     this.getFreshValueHex = function() {
    +1254         return this.hV;
    +1255     };
    +1256 
    +1257     this.setByParam = function(params) {
    +1258         if (typeof params === "string") {
    +1259 	    this.setValueNameOrOid(params);
    +1260         } else if (params.oid !== undefined) {
    +1261 	    this.setValueNameOrOid(params.oid);
    +1262         } else if (params.name !== undefined) {
    +1263             this.setValueNameOrOid(params.name);
    +1264         } else if (params.hex !== undefined) {
    +1265             this.setValueHex(params.hex);
    +1266         }
    +1267     };
    +1268 
    +1269     if (params !== undefined) this.setByParam(params);
    +1270 };
    +1271 YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);
    +1272 
    +1273 // ********************************************************************
    +1274 /**
    +1275  * class for ASN.1 DER Enumerated
    +1276  * @name KJUR.asn1.DEREnumerated
    +1277  * @class class for ASN.1 DER Enumerated
    +1278  * @extends KJUR.asn1.ASN1Object
    +1279  * @description
    +1280  * <br/>
    +1281  * As for argument 'params' for constructor, you can specify one of
    +1282  * following properties:
    +1283  * <ul>
    +1284  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    +1285  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +1286  * </ul>
    +1287  * NOTE: 'params' can be omitted.
    +1288  * @example
    +1289  * new KJUR.asn1.DEREnumerated(123);
    +1290  * new KJUR.asn1.DEREnumerated({int: 123});
    +1291  * new KJUR.asn1.DEREnumerated({hex: '1fad'});
    +1292  */
    +1293 KJUR.asn1.DEREnumerated = function(params) {
    +1294     KJUR.asn1.DEREnumerated.superclass.constructor.call(this);
    +1295     this.hT = "0a";
    +1296 
    +1297     /**
    +1298      * set value by Tom Wu's BigInteger object
    +1299      * @name setByBigInteger
    +1300      * @memberOf KJUR.asn1.DEREnumerated#
    +1301      * @function
    +1302      * @param {BigInteger} bigIntegerValue to set
    +1303      */
    +1304     this.setByBigInteger = function(bigIntegerValue) {
    +1305         this.hTLV = null;
    +1306         this.isModified = true;
    +1307         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    +1308     };
    +1309 
    +1310     /**
    +1311      * set value by integer value
    +1312      * @name setByInteger
    +1313      * @memberOf KJUR.asn1.DEREnumerated#
    +1314      * @function
    +1315      * @param {Integer} integer value to set
    +1316      */
    +1317     this.setByInteger = function(intValue) {
    +1318         var bi = new BigInteger(String(intValue), 10);
    +1319         this.setByBigInteger(bi);
    +1320     };
    +1321 
    +1322     /**
    +1323      * set value by integer value
    +1324      * @name setValueHex
    +1325      * @memberOf KJUR.asn1.DEREnumerated#
    +1326      * @function
    +1327      * @param {String} hexadecimal string of integer value
    +1328      * @description
    +1329      * <br/>
    +1330      * NOTE: Value shall be represented by minimum octet length of
    +1331      * two's complement representation.
    +1332      */
    +1333     this.setValueHex = function(newHexString) {
    +1334         this.hV = newHexString;
    +1335     };
    +1336 
    +1337     this.getFreshValueHex = function() {
    +1338         return this.hV;
    +1339     };
    +1340 
    +1341     if (typeof params != "undefined") {
    +1342         if (typeof params['int'] != "undefined") {
    +1343             this.setByInteger(params['int']);
    +1344         } else if (typeof params == "number") {
    +1345             this.setByInteger(params);
    +1346         } else if (typeof params['hex'] != "undefined") {
    +1347             this.setValueHex(params['hex']);
    +1348         }
    +1349     }
    +1350 };
    +1351 YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object);
    +1352 
    +1353 // ********************************************************************
    +1354 /**
    +1355  * class for ASN.1 DER UTF8String
    +1356  * @name KJUR.asn1.DERUTF8String
    +1357  * @class class for ASN.1 DER UTF8String
    +1358  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1359  * @extends KJUR.asn1.DERAbstractString
    +1360  * @description
    +1361  * @see KJUR.asn1.DERAbstractString - superclass
    +1362  */
    +1363 KJUR.asn1.DERUTF8String = function(params) {
    +1364     KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);
    +1365     this.hT = "0c";
    +1366 };
    +1367 YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);
    +1368 
    +1369 // ********************************************************************
    +1370 /**
    +1371  * class for ASN.1 DER NumericString
    +1372  * @name KJUR.asn1.DERNumericString
    +1373  * @class class for ASN.1 DER NumericString
    +1374  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1375  * @extends KJUR.asn1.DERAbstractString
    +1376  * @description
    +1377  * @see KJUR.asn1.DERAbstractString - superclass
    +1378  */
    +1379 KJUR.asn1.DERNumericString = function(params) {
    +1380     KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);
    +1381     this.hT = "12";
    +1382 };
    +1383 YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);
    +1384 
    +1385 // ********************************************************************
    +1386 /**
    +1387  * class for ASN.1 DER PrintableString
    +1388  * @name KJUR.asn1.DERPrintableString
    +1389  * @class class for ASN.1 DER PrintableString
    +1390  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1391  * @extends KJUR.asn1.DERAbstractString
    +1392  * @description
    +1393  * @see KJUR.asn1.DERAbstractString - superclass
    +1394  */
    +1395 KJUR.asn1.DERPrintableString = function(params) {
    +1396     KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);
    +1397     this.hT = "13";
    +1398 };
    +1399 YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);
    +1400 
    +1401 // ********************************************************************
    +1402 /**
    +1403  * class for ASN.1 DER TeletexString
    +1404  * @name KJUR.asn1.DERTeletexString
    +1405  * @class class for ASN.1 DER TeletexString
    +1406  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1407  * @extends KJUR.asn1.DERAbstractString
    +1408  * @description
    +1409  * @see KJUR.asn1.DERAbstractString - superclass
    +1410  */
    +1411 KJUR.asn1.DERTeletexString = function(params) {
    +1412     KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);
    +1413     this.hT = "14";
    +1414 };
    +1415 YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);
    +1416 
    +1417 // ********************************************************************
    +1418 /**
    +1419  * class for ASN.1 DER IA5String
    +1420  * @name KJUR.asn1.DERIA5String
    +1421  * @class class for ASN.1 DER IA5String
    +1422  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1423  * @extends KJUR.asn1.DERAbstractString
    +1424  * @description
    +1425  * @see KJUR.asn1.DERAbstractString - superclass
    +1426  */
    +1427 KJUR.asn1.DERIA5String = function(params) {
    +1428     KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
    +1429     this.hT = "16";
    +1430 };
    +1431 YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);
    +1432 
    +1433 // ********************************************************************
    +1434 /**
    +1435  * class for ASN.1 DER VisibleString
    +1436  * @name KJUR.asn1.DERVisibleString
    +1437  * @class class for ASN.1 DER VisibleString
    +1438  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1439  * @extends KJUR.asn1.DERAbstractString
    +1440  * @since jsrsasign 8.0.23 asn1 1.0.15
    +1441  * @description
    +1442  * @see KJUR.asn1.DERAbstractString - superclass
    +1443  */
    +1444 KJUR.asn1.DERVisibleString = function(params) {
    +1445     KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
    +1446     this.hT = "1a";
    +1447 };
    +1448 YAHOO.lang.extend(KJUR.asn1.DERVisibleString, KJUR.asn1.DERAbstractString);
    +1449 
    +1450 // ********************************************************************
    +1451 /**
    +1452  * class for ASN.1 DER BMPString
    +1453  * @name KJUR.asn1.DERBMPString
    +1454  * @class class for ASN.1 DER BMPString
    +1455  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1456  * @extends KJUR.asn1.DERAbstractString
    +1457  * @since jsrsasign 8.0.23 asn1 1.0.15
    +1458  * @description
    +1459  * @see KJUR.asn1.DERAbstractString - superclass
    +1460  */
    +1461 KJUR.asn1.DERBMPString = function(params) {
    +1462     KJUR.asn1.DERBMPString.superclass.constructor.call(this, params);
    +1463     this.hT = "1e";
    +1464 };
    +1465 YAHOO.lang.extend(KJUR.asn1.DERBMPString, KJUR.asn1.DERAbstractString);
    +1466 
    +1467 // ********************************************************************
    +1468 /**
    +1469  * class for ASN.1 DER UTCTime
    +1470  * @name KJUR.asn1.DERUTCTime
    +1471  * @class class for ASN.1 DER UTCTime
    +1472  * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
    +1473  * @extends KJUR.asn1.DERAbstractTime
    +1474  * @description
    +1475  * <br/>
    +1476  * As for argument 'params' for constructor, you can specify one of
    +1477  * following properties:
    +1478  * <ul>
    +1479  * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
    +1480  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +1481  * <li>date - specify Date object.</li>
    +1482  * </ul>
    +1483  * NOTE: 'params' can be omitted.
    +1484  * <h4>EXAMPLES</h4>
    +1485  * @example
    +1486  * d1 = new KJUR.asn1.DERUTCTime();
    +1487  * d1.setString('130430125959Z');
    +1488  *
    +1489  * d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
    +1490  * d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
    +1491  * d4 = new KJUR.asn1.DERUTCTime('130430125959Z');
    +1492  */
    +1493 KJUR.asn1.DERUTCTime = function(params) {
    +1494     KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);
    +1495     this.hT = "17";
    +1496 
    +1497     /**
    +1498      * set value by a Date object<br/>
    +1499      * @name setByDate
    +1500      * @memberOf KJUR.asn1.DERUTCTime#
    +1501      * @function
    +1502      * @param {Date} dateObject Date object to set ASN.1 value(V)
    +1503      * @example
    +1504      * o = new KJUR.asn1.DERUTCTime();
    +1505      * o.setByDate(new Date("2016/12/31"));
    +1506      */
    +1507     this.setByDate = function(dateObject) {
    +1508         this.hTLV = null;
    +1509         this.isModified = true;
    +1510         this.date = dateObject;
    +1511         this.s = this.formatDate(this.date, 'utc');
    +1512         this.hV = stohex(this.s);
    +1513     };
    +1514 
    +1515     this.getFreshValueHex = function() {
    +1516         if (typeof this.date == "undefined" && typeof this.s == "undefined") {
    +1517             this.date = new Date();
    +1518             this.s = this.formatDate(this.date, 'utc');
    +1519             this.hV = stohex(this.s);
    +1520         }
    +1521         return this.hV;
    +1522     };
    +1523 
    +1524     if (params !== undefined) {
    +1525         if (params.str !== undefined) {
    +1526             this.setString(params.str);
    +1527         } else if (typeof params == "string" && params.match(/^[0-9]{12}Z$/)) {
    +1528             this.setString(params);
    +1529         } else if (params.hex !== undefined) {
    +1530             this.setStringHex(params.hex);
    +1531         } else if (params.date !== undefined) {
    +1532             this.setByDate(params.date);
    +1533         }
    +1534     }
    +1535 };
    +1536 YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);
    +1537 
    +1538 // ********************************************************************
    +1539 /**
    +1540  * class for ASN.1 DER GeneralizedTime
    +1541  * @name KJUR.asn1.DERGeneralizedTime
    +1542  * @class class for ASN.1 DER GeneralizedTime
    +1543  * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
    +1544  * @property {Boolean} withMillis flag to show milliseconds or not
    +1545  * @extends KJUR.asn1.DERAbstractTime
    +1546  * @description
    +1547  * <br/>
    +1548  * As for argument 'params' for constructor, you can specify one of
    +1549  * following properties:
    +1550  * <ul>
    +1551  * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
    +1552  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +1553  * <li>date - specify Date object.</li>
    +1554  * <li>millis - specify flag to show milliseconds (from 1.0.6)</li>
    +1555  * </ul>
    +1556  * NOTE1: 'params' can be omitted.
    +1557  * NOTE2: 'withMillis' property is supported from asn1 1.0.6.
    +1558  */
    +1559 KJUR.asn1.DERGeneralizedTime = function(params) {
    +1560     KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);
    +1561     this.hT = "18";
    +1562     this.withMillis = false;
    +1563 
    +1564     /**
    +1565      * set value by a Date object
    +1566      * @name setByDate
    +1567      * @memberOf KJUR.asn1.DERGeneralizedTime#
    +1568      * @function
    +1569      * @param {Date} dateObject Date object to set ASN.1 value(V)
    +1570      * @example
    +1571      * When you specify UTC time, use 'Date.UTC' method like this:<br/>
    +1572      * o1 = new DERUTCTime();
    +1573      * o1.setByDate(date);
    +1574      *
    +1575      * date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59
    +1576      */
    +1577     this.setByDate = function(dateObject) {
    +1578         this.hTLV = null;
    +1579         this.isModified = true;
    +1580         this.date = dateObject;
    +1581         this.s = this.formatDate(this.date, 'gen', this.withMillis);
    +1582         this.hV = stohex(this.s);
    +1583     };
    +1584 
    +1585     this.getFreshValueHex = function() {
    +1586         if (this.date === undefined && this.s === undefined) {
    +1587             this.date = new Date();
    +1588             this.s = this.formatDate(this.date, 'gen', this.withMillis);
    +1589             this.hV = stohex(this.s);
    +1590         }
    +1591         return this.hV;
    +1592     };
    +1593 
    +1594     if (params !== undefined) {
    +1595         if (params.str !== undefined) {
    +1596             this.setString(params.str);
    +1597         } else if (typeof params == "string" && params.match(/^[0-9]{14}Z$/)) {
    +1598             this.setString(params);
    +1599         } else if (params.hex !== undefined) {
    +1600             this.setStringHex(params.hex);
    +1601         } else if (params.date !== undefined) {
    +1602             this.setByDate(params.date);
    +1603         }
    +1604         if (params.millis === true) {
    +1605             this.withMillis = true;
    +1606         }
    +1607     }
    +1608 };
    +1609 YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);
    +1610 
    +1611 // ********************************************************************
    +1612 /**
    +1613  * class for ASN.1 DER Sequence
    +1614  * @name KJUR.asn1.DERSequence
    +1615  * @class class for ASN.1 DER Sequence
    +1616  * @extends KJUR.asn1.DERAbstractStructured
    +1617  * @description
    +1618  * <br/>
    +1619  * As for argument 'params' for constructor, you can specify one of
    +1620  * following properties:
    +1621  * <ul>
    +1622  * <li>array - specify array of ASN1Object to set elements of content</li>
    +1623  * </ul>
    +1624  * NOTE: 'params' can be omitted.
    +1625  */
    +1626 KJUR.asn1.DERSequence = function(params) {
    +1627     KJUR.asn1.DERSequence.superclass.constructor.call(this, params);
    +1628     this.hT = "30";
    +1629     this.getFreshValueHex = function() {
    +1630         var h = '';
    +1631         for (var i = 0; i < this.asn1Array.length; i++) {
    +1632             var asn1Obj = this.asn1Array[i];
    +1633             h += asn1Obj.getEncodedHex();
    +1634         }
    +1635         this.hV = h;
    +1636         return this.hV;
    +1637     };
    +1638 };
    +1639 YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);
    +1640 
    +1641 // ********************************************************************
    +1642 /**
    +1643  * class for ASN.1 DER Set
    +1644  * @name KJUR.asn1.DERSet
    +1645  * @class class for ASN.1 DER Set
    +1646  * @extends KJUR.asn1.DERAbstractStructured
    +1647  * @description
    +1648  * <br/>
    +1649  * As for argument 'params' for constructor, you can specify one of
    +1650  * following properties:
    +1651  * <ul>
    +1652  * <li>array - specify array of ASN1Object to set elements of content</li>
    +1653  * <li>sortflag - flag for sort (default: true). ASN.1 BER is not sorted in 'SET OF'.</li>
    +1654  * </ul>
    +1655  * NOTE1: 'params' can be omitted.<br/>
    +1656  * NOTE2: sortflag is supported since 1.0.5.
    +1657  */
    +1658 KJUR.asn1.DERSet = function(params) {
    +1659     KJUR.asn1.DERSet.superclass.constructor.call(this, params);
    +1660     this.hT = "31";
    +1661     this.sortFlag = true; // item shall be sorted only in ASN.1 DER
    +1662     this.getFreshValueHex = function() {
    +1663         var a = new Array();
    +1664         for (var i = 0; i < this.asn1Array.length; i++) {
    +1665             var asn1Obj = this.asn1Array[i];
    +1666             a.push(asn1Obj.getEncodedHex());
    +1667         }
    +1668         if (this.sortFlag == true) a.sort();
    +1669         this.hV = a.join('');
    +1670         return this.hV;
    +1671     };
     1672 
    -1673 // ********************************************************************
    -1674 /**
    -1675  * class for ASN.1 DER TaggedObject
    -1676  * @name KJUR.asn1.DERTaggedObject
    -1677  * @class class for ASN.1 DER TaggedObject
    -1678  * @extends KJUR.asn1.ASN1Object
    -1679  *
    -1680  * @description
    -1681  * <br/>
    -1682  * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.
    -1683  * For example, if you find '[1]' tag in a ASN.1 dump, 
    -1684  * 'tagNoHex' will be 'a1'.
    -1685  * <br/>
    -1686  * As for optional argument 'params' for constructor, you can specify *ANY* of
    -1687  * following properties:
    -1688  * <ul>
    -1689  * <li>tag - specify tag (default is 'a0' which means [0])</li>
    -1690  * <li>explicit - specify true if this is explicit tag otherwise false 
    -1691  *     (default is 'true').</li>
    -1692  * <li>obj - specify ASN1Object which is tagged</li>
    -1693  * <li>tage - specify tag with explicit</li>
    -1694  * <li>tagi - specify tag with implicit</li>
    -1695  * </ul>
    -1696  *
    -1697  * @example
    -1698  * new KJUR.asn1.DERTaggedObject({
    -1699  *  tage:'a0', obj: new KJUR.asn1.DERInteger({int: 3}) // explicit
    -1700  * }) 
    -1701  * new KJUR.asn1.DERTaggedObject({
    -1702  *  tagi:'a0', obj: new KJUR.asn1.DERInteger({int: 3}) // implicit
    -1703  * }) 
    -1704  * new KJUR.asn1.DERTaggedObject({
    -1705  *  tag:'a0', explicit: true, obj: new KJUR.asn1.DERInteger({int: 3}) // explicit
    -1706  * }) 
    -1707  *
    -1708  * // to hexadecimal
    -1709  * d1 = new KJUR.asn1.DERUTF8String({str':'a'})
    -1710  * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});
    -1711  * hex = d2.getEncodedHex();
    -1712  */
    -1713 KJUR.asn1.DERTaggedObject = function(params) {
    -1714     KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);
    -1715 
    -1716     var _KJUR_asn1 = KJUR.asn1;
    -1717 
    -1718     this.hT = "a0";
    -1719     this.hV = '';
    -1720     this.isExplicit = true;
    -1721     this.asn1Object = null;
    -1722 
    -1723     /**
    -1724      * set value by an ASN1Object
    -1725      * @name setString
    -1726      * @memberOf KJUR.asn1.DERTaggedObject#
    -1727      * @function
    -1728      * @param {Boolean} isExplicitFlag flag for explicit/implicit tag
    -1729      * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag
    -1730      * @param {ASN1Object} asn1Object ASN.1 to encapsulate
    -1731      */
    -1732     this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {
    -1733         this.hT = tagNoHex;
    -1734         this.isExplicit = isExplicitFlag;
    -1735         this.asn1Object = asn1Object;
    -1736         if (this.isExplicit) {
    -1737             this.hV = this.asn1Object.getEncodedHex();
    -1738             this.hTLV = null;
    -1739             this.isModified = true;
    -1740         } else {
    -1741             this.hV = null;
    -1742             this.hTLV = asn1Object.getEncodedHex();
    -1743             this.hTLV = this.hTLV.replace(/^../, tagNoHex);
    -1744             this.isModified = false;
    -1745         }
    -1746     };
    -1747 
    -1748     this.getFreshValueHex = function() {
    -1749         return this.hV;
    -1750     };
    -1751 
    -1752     this.setByParam = function(params) {
    -1753         if (params.tag != undefined) {
    -1754             this.hT = params.tag;
    -1755         }
    -1756         if (params.explicit != undefined) {
    -1757             this.isExplicit = params.explicit;
    -1758         }
    -1759 	if (params.tage != undefined) {
    -1760 	    this.hT = params.tage;
    -1761             this.isExplicit = true;
    -1762 	}
    -1763 	if (params.tagi != undefined) {
    -1764 	    this.hT = params.tagi;
    -1765             this.isExplicit = false;
    -1766 	}
    -1767         if (params.obj != undefined) {
    -1768 	    if (params.obj instanceof _KJUR_asn1.ASN1Object) {
    -1769 		this.asn1Object = params.obj;
    -1770 		this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);
    -1771 	    } else if (typeof params.obj == "object") {
    -1772 		this.asn1Object = _KJUR_asn1.ASN1Util.newObject(params.obj);
    -1773 		this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);
    -1774 	    }
    -1775         }
    -1776     };
    -1777 
    -1778     if (params != undefined) this.setByParam(params);
    -1779 };
    -1780 YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
    -1781 
    \ No newline at end of file +1673
    if (typeof params != "undefined") { +1674 if (typeof params.sortflag != "undefined" && +1675 params.sortflag == false) +1676 this.sortFlag = false; +1677 } +1678 }; +1679 YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured); +1680 +1681 // ******************************************************************** +1682 /** +1683 * class for ASN.1 DER TaggedObject +1684 * @name KJUR.asn1.DERTaggedObject +1685 * @class class for ASN.1 DER TaggedObject +1686 * @extends KJUR.asn1.ASN1Object +1687 * +1688 * @description +1689 * <br/> +1690 * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object. +1691 * For example, if you find '[1]' tag in a ASN.1 dump, +1692 * 'tagNoHex' will be 'a1'. +1693 * <br/> +1694 * As for optional argument 'params' for constructor, you can specify *ANY* of +1695 * following properties: +1696 * <ul> +1697 * <li>tag - specify tag (default is 'a0' which means [0])</li> +1698 * <li>explicit - specify true if this is explicit tag otherwise false +1699 * (default is 'true').</li> +1700 * <li>obj - specify ASN1Object which is tagged</li> +1701 * <li>tage - specify tag with explicit</li> +1702 * <li>tagi - specify tag with implicit</li> +1703 * </ul> +1704 * +1705 * @example +1706 * new KJUR.asn1.DERTaggedObject({ +1707 * tage:'a0', obj: new KJUR.asn1.DERInteger({int: 3}) // explicit +1708 * }) +1709 * new KJUR.asn1.DERTaggedObject({ +1710 * tagi:'a0', obj: new KJUR.asn1.DERInteger({int: 3}) // implicit +1711 * }) +1712 * new KJUR.asn1.DERTaggedObject({ +1713 * tag:'a0', explicit: true, obj: new KJUR.asn1.DERInteger({int: 3}) // explicit +1714 * }) +1715 * +1716 * // to hexadecimal +1717 * d1 = new KJUR.asn1.DERUTF8String({str':'a'}) +1718 * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1}); +1719 * hex = d2.getEncodedHex(); +1720 */ +1721 KJUR.asn1.DERTaggedObject = function(params) { +1722 KJUR.asn1.DERTaggedObject.superclass.constructor.call(this); +1723 +1724 var _KJUR_asn1 = KJUR.asn1; +1725 +1726 this.hT = "a0"; +1727 this.hV = ''; +1728 this.isExplicit = true; +1729 this.asn1Object = null; +1730 +1731 /** +1732 * set value by an ASN1Object +1733 * @name setString +1734 * @memberOf KJUR.asn1.DERTaggedObject# +1735 * @function +1736 * @param {Boolean} isExplicitFlag flag for explicit/implicit tag +1737 * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag +1738 * @param {ASN1Object} asn1Object ASN.1 to encapsulate +1739 */ +1740 this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) { +1741 this.hT = tagNoHex; +1742 this.isExplicit = isExplicitFlag; +1743 this.asn1Object = asn1Object; +1744 if (this.isExplicit) { +1745 this.hV = this.asn1Object.getEncodedHex(); +1746 this.hTLV = null; +1747 this.isModified = true; +1748 } else { +1749 this.hV = null; +1750 this.hTLV = asn1Object.getEncodedHex(); +1751 this.hTLV = this.hTLV.replace(/^../, tagNoHex); +1752 this.isModified = false; +1753 } +1754 }; +1755 +1756 this.getFreshValueHex = function() { +1757 return this.hV; +1758 }; +1759 +1760 this.setByParam = function(params) { +1761 if (params.tag != undefined) { +1762 this.hT = params.tag; +1763 } +1764 if (params.explicit != undefined) { +1765 this.isExplicit = params.explicit; +1766 } +1767 if (params.tage != undefined) { +1768 this.hT = params.tage; +1769 this.isExplicit = true; +1770 } +1771 if (params.tagi != undefined) { +1772 this.hT = params.tagi; +1773 this.isExplicit = false; +1774 } +1775 if (params.obj != undefined) { +1776 if (params.obj instanceof _KJUR_asn1.ASN1Object) { +1777 this.asn1Object = params.obj; +1778 this.setASN1Object(this.isExplicit, this.hT, this.asn1Object); +1779 } else if (typeof params.obj == "object") { +1780 this.asn1Object = _KJUR_asn1.ASN1Util.newObject(params.obj); +1781 this.setASN1Object(this.isExplicit, this.hT, this.asn1Object); +1782 } +1783 } +1784 }; +1785 +1786 if (params != undefined) this.setByParam(params); +1787 }; +1788 YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object); +1789
    \ No newline at end of file diff --git a/api/symbols/src/asn1x509-1.0.js.html b/api/symbols/src/asn1x509-1.0.js.html index b02b10b8..4a221aab 100644 --- a/api/symbols/src/asn1x509-1.0.js.html +++ b/api/symbols/src/asn1x509-1.0.js.html @@ -5,7 +5,7 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 /* asn1x509-2.1.3.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
    +	
      1 /* asn1x509-2.1.4.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
       2  */
       3 /*
       4  * asn1x509.js - ASN.1 DER encoder classes for X.509 certificate
    @@ -23,7 +23,7 @@
      16  * @fileOverview
      17  * @name asn1x509-1.0.js
      18  * @author Kenji Urushima kenji.urushima@gmail.com
    - 19  * @version jsrsasign 10.0.0 asn1x509 2.1.3 (2020-Sep-22)
    + 19  * @version jsrsasign 10.0.1 asn1x509 2.1.4 (2020-Oct-12)
      20  * @since jsrsasign 2.1
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -463,3686 +463,3756 @@
     456 		obj = new _KJUR_asn1_x509.OCSPNonce(param);
     457 	    } else if (extname == "ocspNoCheck") {
     458 		obj = new _KJUR_asn1_x509.OCSPNoCheck(param);
    -459 	    } else {
    -460 		throw new Error("extension not supported:"
    -461 				+ JSON.stringify(param));
    -462 	    }
    -463 	    if (obj != null) a.push(obj);
    -464 	}
    -465 
    -466 	var seq = new _DERSequence({array: a});
    -467 	return seq.getEncodedHex();
    -468     };
    -469 
    -470     if (aParam != undefined) this.setByParam(aParam);
    -471 };
    -472 YAHOO.lang.extend(KJUR.asn1.x509.Extensions, KJUR.asn1.ASN1Object);
    -473 
    -474 
    -475 // === END   TBSCertificate ===================================================
    +459 	    } else if (extname == "adobeTimeStamp") {
    +460 		obj = new _KJUR_asn1_x509.AdobeTimeStamp(param);
    +461 	    } else {
    +462 		throw new Error("extension not supported:"
    +463 				+ JSON.stringify(param));
    +464 	    }
    +465 	    if (obj != null) a.push(obj);
    +466 	}
    +467 
    +468 	var seq = new _DERSequence({array: a});
    +469 	return seq.getEncodedHex();
    +470     };
    +471 
    +472     if (aParam != undefined) this.setByParam(aParam);
    +473 };
    +474 YAHOO.lang.extend(KJUR.asn1.x509.Extensions, KJUR.asn1.ASN1Object);
    +475 
     476 
    -477 // === BEGIN X.509v3 Extensions Related =======================================
    +477 // === END   TBSCertificate ===================================================
     478 
    -479 /**
    -480  * base Extension ASN.1 structure class
    -481  * @name KJUR.asn1.x509.Extension
    -482  * @class base Extension ASN.1 structure class
    -483  * @param {Array} params associative array of parameters (ex. {'critical': true})
    -484  * @extends KJUR.asn1.ASN1Object
    -485  * @description
    -486  * <pre>
    -487  * Extension  ::=  SEQUENCE  {
    -488  *     extnID      OBJECT IDENTIFIER,
    -489  *     critical    BOOLEAN DEFAULT FALSE,
    -490  *     extnValue   OCTET STRING  }
    -491  * </pre>
    -492  * @example
    -493  */
    -494 KJUR.asn1.x509.Extension = function(params) {
    -495     KJUR.asn1.x509.Extension.superclass.constructor.call(this);
    -496     var asn1ExtnValue = null,
    -497 	_KJUR = KJUR,
    -498 	_KJUR_asn1 = _KJUR.asn1,
    -499 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -500 	_DEROctetString = _KJUR_asn1.DEROctetString,
    -501 	_DERBitString = _KJUR_asn1.DERBitString,
    -502 	_DERBoolean = _KJUR_asn1.DERBoolean,
    -503 	_DERSequence = _KJUR_asn1.DERSequence;
    -504 
    -505     this.getEncodedHex = function() {
    -506         var asn1Oid = new _DERObjectIdentifier({'oid': this.oid});
    -507         var asn1EncapExtnValue =
    -508             new _DEROctetString({'hex': this.getExtnValueHex()});
    -509 
    -510         var asn1Array = new Array();
    -511         asn1Array.push(asn1Oid);
    -512         if (this.critical) asn1Array.push(new _DERBoolean());
    -513         asn1Array.push(asn1EncapExtnValue);
    -514 
    -515         var asn1Seq = new _DERSequence({'array': asn1Array});
    -516         return asn1Seq.getEncodedHex();
    -517     };
    -518 
    -519     this.critical = false;
    -520     if (params !== undefined) {
    -521         if (params.critical !== undefined) {
    -522             this.critical = params.critical;
    -523         }
    -524     }
    -525 };
    -526 YAHOO.lang.extend(KJUR.asn1.x509.Extension, KJUR.asn1.ASN1Object);
    -527 
    -528 /**
    -529  * KeyUsage ASN.1 structure class
    -530  * @name KJUR.asn1.x509.KeyUsage
    -531  * @class KeyUsage ASN.1 structure class
    -532  * @param {Array} params associative array of parameters (ex. {'bin': '11', 'critical': true})
    -533  * @extends KJUR.asn1.x509.Extension
    -534  * @description
    -535  * This class is for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.3" target="_blank">KeyUsage</a> X.509v3 extension.
    -536  * <pre>
    -537  * id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    -538  * KeyUsage ::= BIT STRING {
    -539  *   digitalSignature   (0),
    -540  *   nonRepudiation     (1),
    -541  *   keyEncipherment    (2),
    -542  *   dataEncipherment   (3),
    -543  *   keyAgreement       (4),
    -544  *   keyCertSign        (5),
    -545  *   cRLSign            (6),
    -546  *   encipherOnly       (7),
    -547  *   decipherOnly       (8) }
    -548  * </pre><br/>
    -549  * NOTE: 'names' parameter is supprted since jsrsasign 8.0.14.
    -550  * @example
    -551  * o = new KJUR.asn1.x509.KeyUsage({bin: "11"});
    -552  * o = new KJUR.asn1.x509.KeyUsage({critical: true, bin: "11"});
    -553  * o = new KJUR.asn1.x509.KeyUsage({names: ['digitalSignature', 'keyAgreement']});
    -554  */
    -555 KJUR.asn1.x509.KeyUsage = function(params) {
    -556     KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this, params);
    -557     var _KEYUSAGE_NAME = X509.KEYUSAGE_NAME;
    -558 
    -559     this.getExtnValueHex = function() {
    -560         return this.asn1ExtnValue.getEncodedHex();
    -561     };
    -562 
    -563     this.oid = "2.5.29.15";
    -564     if (params !== undefined) {
    -565         if (params.bin !== undefined) {
    -566             this.asn1ExtnValue = new KJUR.asn1.DERBitString(params);
    -567         }
    -568 	if (params.names !== undefined &&
    -569 	    params.names.length !== undefined) {
    -570 	    var names = params.names;
    -571 	    var s = "000000000";
    -572 	    for (var i = 0; i < names.length; i++) {
    -573 		for (var j = 0; j < _KEYUSAGE_NAME.length; j++) {
    -574 		    if (names[i] === _KEYUSAGE_NAME[j]) {
    -575 			s = s.substring(0, j) + '1' + 
    -576 			    s.substring(j + 1, s.length);
    -577 		    }
    -578 		}
    -579 	    }
    -580             this.asn1ExtnValue = new KJUR.asn1.DERBitString({bin: s});
    -581 	}
    -582     }
    -583 };
    -584 YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage, KJUR.asn1.x509.Extension);
    -585 
    -586 /**
    -587  * BasicConstraints ASN.1 structure class
    -588  * @name KJUR.asn1.x509.BasicConstraints
    -589  * @class BasicConstraints ASN.1 structure class
    -590  * @param {Array} params JSON object for parameters (ex. {cA:true,critical:true})
    -591  * @extends KJUR.asn1.x509.Extension
    -592  * @see {@link X509#getExtBasicConstraints}
    -593  * @description
    -594  * This class represents 
    -595  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.9">
    -596  * BasicConstraints extension defined in RFC 5280 4.2.1.9</a>.
    -597  * <pre>
    -598  *  id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 }
    -599  *  BasicConstraints ::= SEQUENCE {
    -600  *       cA                      BOOLEAN DEFAULT FALSE,
    -601  *       pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
    -602  * </pre>
    -603  * Its constructor can have following parameters:
    -604  * <ul>
    -605  * <li>{Boolean}cA - cA flag</li>
    -606  * <li>{Integer}pathLen - pathLen field value</li>
    -607  * <li>{Boolean}critical - critical flag</li>
    -608  * </ul>
    -609  * @example
    -610  * new KJUR.asn1.x509.BasicConstraints({
    -611  *   cA: true,
    -612  *   pathLen: 3,
    -613  *   critical: true
    -614  * })
    -615  */
    -616 KJUR.asn1.x509.BasicConstraints = function(params) {
    -617     KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this, params);
    -618     var _KJUR_asn1 = KJUR.asn1,
    -619 	_DERBoolean = _KJUR_asn1.DERBoolean,
    -620 	_DERInteger = _KJUR_asn1.DERInteger,
    -621 	_DERSequence = _KJUR_asn1.DERSequence;
    -622 
    -623     var cA = false;
    -624     var pathLen = -1;
    -625 
    -626     this.getExtnValueHex = function() {
    -627         var asn1Array = new Array();
    -628         if (this.cA) asn1Array.push(new _DERBoolean());
    -629         if (this.pathLen > -1)
    -630             asn1Array.push(new _DERInteger({'int': this.pathLen}));
    -631         var asn1Seq = new _DERSequence({'array': asn1Array});
    -632         this.asn1ExtnValue = asn1Seq;
    -633         return this.asn1ExtnValue.getEncodedHex();
    -634     };
    -635 
    -636     this.oid = "2.5.29.19";
    -637     this.cA = false;
    -638     this.pathLen = -1;
    -639     if (params !== undefined) {
    -640         if (params.cA !== undefined) {
    -641             this.cA = params.cA;
    -642         }
    -643         if (params.pathLen !== undefined) {
    -644             this.pathLen = params.pathLen;
    -645         }
    -646     }
    -647 };
    -648 YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints, KJUR.asn1.x509.Extension);
    -649 
    -650 /**
    -651  * CRLDistributionPoints ASN.1 structure class
    -652  * @name KJUR.asn1.x509.CRLDistributionPoints
    -653  * @class CRLDistributionPoints ASN.1 structure class
    -654  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
    -655  * @extends KJUR.asn1.x509.Extension
    -656  * @see {@link X509#getExtCRLDistributionPoints}
    -657  * @see {@link KJUR.asn1.x509.DistributionPoint}
    -658  * @see {@link KJUR.asn1.x509.GeneralNames}
    -659  * @description
    -660  * This class represents 
    -661  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    -662  * CRLDistributionPoints extension defined in RFC 5280 4.2.1.13</a>.
    -663  * <pre>
    -664  * id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 }
    -665  * CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
    -666  * DistributionPoint ::= SEQUENCE {
    -667  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    -668  *      reasons                 [1]     ReasonFlags OPTIONAL,
    -669  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    -670  * DistributionPointName ::= CHOICE {
    -671  *      fullName                [0]     GeneralNames,
    -672  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    -673  * </pre>
    -674  * Constructor can have following parameter:
    -675  * <ul>
    -676  * <li>{Array}array - array of {@link KJUR.asn1.x509.DistributionPoint} parameter</li>
    -677  * <li>{Boolean}critical - critical flag</li>
    -678  * </ul>
    -679  * @example
    -680  * new KJUR.asn1.x509.CRLDistributionPoints({
    -681  *   array: [{fulluri: "http://aaa.com/"}, {fulluri: "ldap://aaa.com/"}],
    -682  *   critical: true
    -683  * })
    -684  */
    -685 KJUR.asn1.x509.CRLDistributionPoints = function(params) {
    -686     KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this, params);
    -687     var _KJUR = KJUR,
    -688 	_KJUR_asn1 = _KJUR.asn1,
    -689 	_KJUR_asn1_x509 = _KJUR_asn1.x509;
    -690 
    -691     this.getExtnValueHex = function() {
    -692         return this.asn1ExtnValue.getEncodedHex();
    -693     };
    -694 
    -695     this.setByDPArray = function(dpArray) {
    -696 	var asn1Array = [];
    -697 	for (var i = 0; i < dpArray.length; i++) {
    -698 	    if (dpArray[i] instanceof KJUR.asn1.ASN1Object) {
    -699 		asn1Array.push(dpArray[i]);
    -700 	    } else {
    -701 		var dp = new _KJUR_asn1_x509.DistributionPoint(dpArray[i]);
    -702 		asn1Array.push(dp);
    -703 	    }
    -704 	}
    -705         this.asn1ExtnValue = new _KJUR_asn1.DERSequence({'array': asn1Array});
    -706     };
    -707 
    -708     this.setByOneURI = function(uri) {
    -709         var dp1 = new _KJUR_asn1_x509.DistributionPoint({fulluri: uri});
    -710         this.setByDPArray([dp1]);
    -711     };
    -712 
    -713     this.oid = "2.5.29.31";
    -714     if (params !== undefined) {
    -715         if (params.array !== undefined) {
    -716             this.setByDPArray(params.array);
    -717         } else if (params.uri !== undefined) {
    -718             this.setByOneURI(params.uri);
    -719         }
    -720     }
    -721 };
    -722 YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints, KJUR.asn1.x509.Extension);
    -723 
    -724 /**
    -725  * DistributionPoint ASN.1 structure class<br/>
    -726  * @name KJUR.asn1.x509.DistributionPoint
    -727  * @class DistributionPoint ASN.1 structure class
    -728  * @param {Array} params JSON object of parameters (OPTIONAL)
    -729  * @extends KJUR.asn1.ASN1Object
    -730  * @see {@link KJUR.asn1.x509.CRLDistributionPoints}
    -731  * @see {@link KJUR.asn1.x509.DistributionPointName}
    -732  * @see {@link KJUR.asn1.x509.GeneralNames}
    -733  * @see {@link X509#getDistributionPoint}
    -734  * @description
    -735  * This class represents 
    -736  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    -737  * DistributionPoint defined in RFC 5280 4.2.1.13</a>.
    -738  * <pre>
    -739  * DistributionPoint ::= SEQUENCE {
    -740  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    -741  *      reasons                 [1]     ReasonFlags OPTIONAL,
    -742  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    -743  * </pre>
    -744  * Constructor can have following parameter:
    -745  * <ul>
    -746  * <li>{String}fulluri - uri string for fullName uri. This has the same meaning for '{dpname: {full: [{uri: "..."]}}'.</li>
    -747  * <li>{Array}dpname - JSON object for {@link KJUR.asn1.x509.DistributionPointName} parameters</li>
    -748  * <li>{DistrubutionPoint}dpobj - {@link KJUR.asn1.x509.DistributionPointName} object (DEPRECATED)</li>
    -749  * </ul>
    -750  * <br/>
    -751  * NOTE1: Parameter "fulluri" and "dpname" supported 
    -752  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    -753  * <br/>
    -754  * NOTE2: The "reasons" and "cRLIssuer" fields are currently
    -755  * not supported.
    -756  * @example
    -757  * new KJUR.asn1.x509.DistributionPoint(
    -758  *   {fulluri: "http://example.com/crl1.crl"})
    +479 // === BEGIN X.509v3 Extensions Related =======================================
    +480 
    +481 /**
    +482  * base Extension ASN.1 structure class
    +483  * @name KJUR.asn1.x509.Extension
    +484  * @class base Extension ASN.1 structure class
    +485  * @param {Array} params associative array of parameters (ex. {'critical': true})
    +486  * @extends KJUR.asn1.ASN1Object
    +487  * @description
    +488  * <pre>
    +489  * Extension  ::=  SEQUENCE  {
    +490  *     extnID      OBJECT IDENTIFIER,
    +491  *     critical    BOOLEAN DEFAULT FALSE,
    +492  *     extnValue   OCTET STRING  }
    +493  * </pre>
    +494  * @example
    +495  */
    +496 KJUR.asn1.x509.Extension = function(params) {
    +497     KJUR.asn1.x509.Extension.superclass.constructor.call(this);
    +498     var asn1ExtnValue = null,
    +499 	_KJUR = KJUR,
    +500 	_KJUR_asn1 = _KJUR.asn1,
    +501 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +502 	_DEROctetString = _KJUR_asn1.DEROctetString,
    +503 	_DERBitString = _KJUR_asn1.DERBitString,
    +504 	_DERBoolean = _KJUR_asn1.DERBoolean,
    +505 	_DERSequence = _KJUR_asn1.DERSequence;
    +506 
    +507     this.getEncodedHex = function() {
    +508         var asn1Oid = new _DERObjectIdentifier({'oid': this.oid});
    +509         var asn1EncapExtnValue =
    +510             new _DEROctetString({'hex': this.getExtnValueHex()});
    +511 
    +512         var asn1Array = new Array();
    +513         asn1Array.push(asn1Oid);
    +514         if (this.critical) asn1Array.push(new _DERBoolean());
    +515         asn1Array.push(asn1EncapExtnValue);
    +516 
    +517         var asn1Seq = new _DERSequence({'array': asn1Array});
    +518         return asn1Seq.getEncodedHex();
    +519     };
    +520 
    +521     this.critical = false;
    +522     if (params !== undefined) {
    +523         if (params.critical !== undefined) {
    +524             this.critical = params.critical;
    +525         }
    +526     }
    +527 };
    +528 YAHOO.lang.extend(KJUR.asn1.x509.Extension, KJUR.asn1.ASN1Object);
    +529 
    +530 /**
    +531  * KeyUsage ASN.1 structure class
    +532  * @name KJUR.asn1.x509.KeyUsage
    +533  * @class KeyUsage ASN.1 structure class
    +534  * @param {Array} params associative array of parameters (ex. {'bin': '11', 'critical': true})
    +535  * @extends KJUR.asn1.x509.Extension
    +536  * @description
    +537  * This class is for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.3" target="_blank">KeyUsage</a> X.509v3 extension.
    +538  * <pre>
    +539  * id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +540  * KeyUsage ::= BIT STRING {
    +541  *   digitalSignature   (0),
    +542  *   nonRepudiation     (1),
    +543  *   keyEncipherment    (2),
    +544  *   dataEncipherment   (3),
    +545  *   keyAgreement       (4),
    +546  *   keyCertSign        (5),
    +547  *   cRLSign            (6),
    +548  *   encipherOnly       (7),
    +549  *   decipherOnly       (8) }
    +550  * </pre><br/>
    +551  * NOTE: 'names' parameter is supprted since jsrsasign 8.0.14.
    +552  * @example
    +553  * o = new KJUR.asn1.x509.KeyUsage({bin: "11"});
    +554  * o = new KJUR.asn1.x509.KeyUsage({critical: true, bin: "11"});
    +555  * o = new KJUR.asn1.x509.KeyUsage({names: ['digitalSignature', 'keyAgreement']});
    +556  */
    +557 KJUR.asn1.x509.KeyUsage = function(params) {
    +558     KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this, params);
    +559     var _KEYUSAGE_NAME = X509.KEYUSAGE_NAME;
    +560 
    +561     this.getExtnValueHex = function() {
    +562         return this.asn1ExtnValue.getEncodedHex();
    +563     };
    +564 
    +565     this.oid = "2.5.29.15";
    +566     if (params !== undefined) {
    +567         if (params.bin !== undefined) {
    +568             this.asn1ExtnValue = new KJUR.asn1.DERBitString(params);
    +569         }
    +570 	if (params.names !== undefined &&
    +571 	    params.names.length !== undefined) {
    +572 	    var names = params.names;
    +573 	    var s = "000000000";
    +574 	    for (var i = 0; i < names.length; i++) {
    +575 		for (var j = 0; j < _KEYUSAGE_NAME.length; j++) {
    +576 		    if (names[i] === _KEYUSAGE_NAME[j]) {
    +577 			s = s.substring(0, j) + '1' + 
    +578 			    s.substring(j + 1, s.length);
    +579 		    }
    +580 		}
    +581 	    }
    +582             this.asn1ExtnValue = new KJUR.asn1.DERBitString({bin: s});
    +583 	}
    +584     }
    +585 };
    +586 YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage, KJUR.asn1.x509.Extension);
    +587 
    +588 /**
    +589  * BasicConstraints ASN.1 structure class
    +590  * @name KJUR.asn1.x509.BasicConstraints
    +591  * @class BasicConstraints ASN.1 structure class
    +592  * @param {Array} params JSON object for parameters (ex. {cA:true,critical:true})
    +593  * @extends KJUR.asn1.x509.Extension
    +594  * @see {@link X509#getExtBasicConstraints}
    +595  * @description
    +596  * This class represents 
    +597  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.9">
    +598  * BasicConstraints extension defined in RFC 5280 4.2.1.9</a>.
    +599  * <pre>
    +600  *  id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 }
    +601  *  BasicConstraints ::= SEQUENCE {
    +602  *       cA                      BOOLEAN DEFAULT FALSE,
    +603  *       pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
    +604  * </pre>
    +605  * Its constructor can have following parameters:
    +606  * <ul>
    +607  * <li>{Boolean}cA - cA flag</li>
    +608  * <li>{Integer}pathLen - pathLen field value</li>
    +609  * <li>{Boolean}critical - critical flag</li>
    +610  * </ul>
    +611  * @example
    +612  * new KJUR.asn1.x509.BasicConstraints({
    +613  *   cA: true,
    +614  *   pathLen: 3,
    +615  *   critical: true
    +616  * })
    +617  */
    +618 KJUR.asn1.x509.BasicConstraints = function(params) {
    +619     KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this, params);
    +620     var _KJUR_asn1 = KJUR.asn1,
    +621 	_DERBoolean = _KJUR_asn1.DERBoolean,
    +622 	_DERInteger = _KJUR_asn1.DERInteger,
    +623 	_DERSequence = _KJUR_asn1.DERSequence;
    +624 
    +625     var cA = false;
    +626     var pathLen = -1;
    +627 
    +628     this.getExtnValueHex = function() {
    +629         var asn1Array = new Array();
    +630         if (this.cA) asn1Array.push(new _DERBoolean());
    +631         if (this.pathLen > -1)
    +632             asn1Array.push(new _DERInteger({'int': this.pathLen}));
    +633         var asn1Seq = new _DERSequence({'array': asn1Array});
    +634         this.asn1ExtnValue = asn1Seq;
    +635         return this.asn1ExtnValue.getEncodedHex();
    +636     };
    +637 
    +638     this.oid = "2.5.29.19";
    +639     this.cA = false;
    +640     this.pathLen = -1;
    +641     if (params !== undefined) {
    +642         if (params.cA !== undefined) {
    +643             this.cA = params.cA;
    +644         }
    +645         if (params.pathLen !== undefined) {
    +646             this.pathLen = params.pathLen;
    +647         }
    +648     }
    +649 };
    +650 YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints, KJUR.asn1.x509.Extension);
    +651 
    +652 /**
    +653  * CRLDistributionPoints ASN.1 structure class
    +654  * @name KJUR.asn1.x509.CRLDistributionPoints
    +655  * @class CRLDistributionPoints ASN.1 structure class
    +656  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
    +657  * @extends KJUR.asn1.x509.Extension
    +658  * @see {@link X509#getExtCRLDistributionPoints}
    +659  * @see {@link KJUR.asn1.x509.DistributionPoint}
    +660  * @see {@link KJUR.asn1.x509.GeneralNames}
    +661  * @description
    +662  * This class represents 
    +663  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    +664  * CRLDistributionPoints extension defined in RFC 5280 4.2.1.13</a>.
    +665  * <pre>
    +666  * id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 }
    +667  * CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
    +668  * DistributionPoint ::= SEQUENCE {
    +669  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    +670  *      reasons                 [1]     ReasonFlags OPTIONAL,
    +671  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    +672  * DistributionPointName ::= CHOICE {
    +673  *      fullName                [0]     GeneralNames,
    +674  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    +675  * </pre>
    +676  * Constructor can have following parameter:
    +677  * <ul>
    +678  * <li>{Array}array - array of {@link KJUR.asn1.x509.DistributionPoint} parameter</li>
    +679  * <li>{Boolean}critical - critical flag</li>
    +680  * </ul>
    +681  * @example
    +682  * new KJUR.asn1.x509.CRLDistributionPoints({
    +683  *   array: [{fulluri: "http://aaa.com/"}, {fulluri: "ldap://aaa.com/"}],
    +684  *   critical: true
    +685  * })
    +686  */
    +687 KJUR.asn1.x509.CRLDistributionPoints = function(params) {
    +688     KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this, params);
    +689     var _KJUR = KJUR,
    +690 	_KJUR_asn1 = _KJUR.asn1,
    +691 	_KJUR_asn1_x509 = _KJUR_asn1.x509;
    +692 
    +693     this.getExtnValueHex = function() {
    +694         return this.asn1ExtnValue.getEncodedHex();
    +695     };
    +696 
    +697     this.setByDPArray = function(dpArray) {
    +698 	var asn1Array = [];
    +699 	for (var i = 0; i < dpArray.length; i++) {
    +700 	    if (dpArray[i] instanceof KJUR.asn1.ASN1Object) {
    +701 		asn1Array.push(dpArray[i]);
    +702 	    } else {
    +703 		var dp = new _KJUR_asn1_x509.DistributionPoint(dpArray[i]);
    +704 		asn1Array.push(dp);
    +705 	    }
    +706 	}
    +707         this.asn1ExtnValue = new _KJUR_asn1.DERSequence({'array': asn1Array});
    +708     };
    +709 
    +710     this.setByOneURI = function(uri) {
    +711         var dp1 = new _KJUR_asn1_x509.DistributionPoint({fulluri: uri});
    +712         this.setByDPArray([dp1]);
    +713     };
    +714 
    +715     this.oid = "2.5.29.31";
    +716     if (params !== undefined) {
    +717         if (params.array !== undefined) {
    +718             this.setByDPArray(params.array);
    +719         } else if (params.uri !== undefined) {
    +720             this.setByOneURI(params.uri);
    +721         }
    +722     }
    +723 };
    +724 YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints, KJUR.asn1.x509.Extension);
    +725 
    +726 /**
    +727  * DistributionPoint ASN.1 structure class<br/>
    +728  * @name KJUR.asn1.x509.DistributionPoint
    +729  * @class DistributionPoint ASN.1 structure class
    +730  * @param {Array} params JSON object of parameters (OPTIONAL)
    +731  * @extends KJUR.asn1.ASN1Object
    +732  * @see {@link KJUR.asn1.x509.CRLDistributionPoints}
    +733  * @see {@link KJUR.asn1.x509.DistributionPointName}
    +734  * @see {@link KJUR.asn1.x509.GeneralNames}
    +735  * @see {@link X509#getDistributionPoint}
    +736  * @description
    +737  * This class represents 
    +738  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    +739  * DistributionPoint defined in RFC 5280 4.2.1.13</a>.
    +740  * <pre>
    +741  * DistributionPoint ::= SEQUENCE {
    +742  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    +743  *      reasons                 [1]     ReasonFlags OPTIONAL,
    +744  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    +745  * </pre>
    +746  * Constructor can have following parameter:
    +747  * <ul>
    +748  * <li>{String}fulluri - uri string for fullName uri. This has the same meaning for '{dpname: {full: [{uri: "..."]}}'.</li>
    +749  * <li>{Array}dpname - JSON object for {@link KJUR.asn1.x509.DistributionPointName} parameters</li>
    +750  * <li>{DistrubutionPoint}dpobj - {@link KJUR.asn1.x509.DistributionPointName} object (DEPRECATED)</li>
    +751  * </ul>
    +752  * <br/>
    +753  * NOTE1: Parameter "fulluri" and "dpname" supported 
    +754  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    +755  * <br/>
    +756  * NOTE2: The "reasons" and "cRLIssuer" fields are currently
    +757  * not supported.
    +758  * @example
     759  * new KJUR.asn1.x509.DistributionPoint(
    -760  *   {dpname: {full: [{uri: "http://example.com/crl1.crl"}]}})
    +760  *   {fulluri: "http://example.com/crl1.crl"})
     761  * new KJUR.asn1.x509.DistributionPoint(
    -762  *   {dpobj: new DistributionPoint(...)})
    -763  */
    -764 KJUR.asn1.x509.DistributionPoint = function(params) {
    -765     KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this);
    -766     var asn1DP = null,
    -767 	_KJUR = KJUR,
    -768 	_KJUR_asn1 = _KJUR.asn1,
    -769 	_DistributionPointName = _KJUR_asn1.x509.DistributionPointName;
    -770 
    -771     this.getEncodedHex = function() {
    -772         var seq = new _KJUR_asn1.DERSequence();
    -773         if (this.asn1DP != null) {
    -774             var o1 = new _KJUR_asn1.DERTaggedObject({'explicit': true,
    -775                                                      'tag': 'a0',
    -776                                                      'obj': this.asn1DP});
    -777             seq.appendASN1Object(o1);
    -778         }
    -779         this.hTLV = seq.getEncodedHex();
    -780         return this.hTLV;
    -781     };
    -782 
    -783     if (params !== undefined) {
    -784         if (params.dpobj !== undefined) {
    -785             this.asn1DP = params.dpobj;
    -786         } else if (params.dpname !== undefined) {
    -787             this.asn1DP = new _DistributionPointName(params.dpname);
    -788 	} else if (params.fulluri !== undefined) {
    -789             this.asn1DP = new _DistributionPointName({full: [{uri: params.fulluri}]});
    -790 	}
    -791     }
    -792 };
    -793 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object);
    -794 
    -795 /**
    -796  * DistributionPointName ASN.1 structure class<br/>
    -797  * @name KJUR.asn1.x509.DistributionPointName
    -798  * @class DistributionPointName ASN.1 structure class
    -799  * @param {Array} params JSON object of parameters or GeneralNames object
    -800  * @extends KJUR.asn1.ASN1Object
    -801  * @see {@link KJUR.asn1.x509.CRLDistributionPoints}
    -802  * @see {@link KJUR.asn1.x509.DistributionPoint}
    -803  * @see {@link KJUR.asn1.x509.GeneralNames}
    -804  * @see {@link X509#getDistributionPointName}
    -805  * @description
    -806  * This class represents 
    -807  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    -808  * DistributionPointName defined in RFC 5280 4.2.1.13</a>.
    -809  * <pre>
    -810  * DistributionPointName ::= CHOICE {
    -811  *      fullName                [0]     GeneralNames,
    -812  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    -813  * </pre>
    -814  * Constructor can have following parameter:
    -815  * <ul>
    -816  * <li>{String}full - JSON object parameter of {@link KJUR.asn1.x509.GeneralNames} for 'fullName' field</li>
    -817  * <li>{GeneralNames} - {@link KJUR.asn1.x509.GeneralNames} object for 'fullName'</li>
    -818  * </ul>
    -819  * NOTE1: 'full' parameter have been suppored since jsrsasign 9.0.0 asn1x509 2.0.0.
    -820  * <br>
    -821  * NOTE2: The 'nameRelativeToCRLIssuer' field is currently not supported.
    -822  * @example
    -823  * new KJUR.asn1.x509.DistributionPointName({full: <<GeneralNamesParameter>>})
    -824  * new KJUR.asn1.x509.DistributionPointName({full: [{uri: <<CDPURI>>}]})
    -825  * new KJUR.asn1.x509.DistributionPointName({full: [{dn: <<DN Parameter>>}]}
    -826  * new KJUR.asn1.x509.DistributionPointName({full: [{uri: "http://example.com/root.crl"}]})
    -827  * new KJUR.asn1.x509.DistributionPointName({full: [{dn {str: "/C=US/O=Test"}}]})
    -828  * new KJUR.asn1.x509.DistributionPointName(new GeneralNames(...))
    -829  */
    -830 KJUR.asn1.x509.DistributionPointName = function(params) {
    -831     KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this);
    -832     var asn1Obj = null,
    -833 	type = null,
    -834 	tag = null,
    -835 	asn1V = null,
    -836 	_KJUR = KJUR,
    -837 	_KJUR_asn1 = _KJUR.asn1,
    -838 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject;
    -839 
    -840     this.getEncodedHex = function() {
    -841         if (this.type != "full")
    -842             throw new Error("currently type shall be 'full': " + this.type);
    -843         this.asn1Obj = new _DERTaggedObject({'explicit': false,
    -844                                              'tag': this.tag,
    -845                                              'obj': this.asn1V});
    -846         this.hTLV = this.asn1Obj.getEncodedHex();
    -847         return this.hTLV;
    -848     };
    -849 
    -850     if (params !== undefined) {
    -851         if (_KJUR_asn1.x509.GeneralNames.prototype.isPrototypeOf(params)) {
    -852             this.type = "full";
    -853             this.tag = "a0";
    -854             this.asn1V = params;
    -855 	} else if (params.full !== undefined) {
    -856             this.type = "full";
    -857             this.tag = "a0";
    -858             this.asn1V = new _KJUR_asn1.x509.GeneralNames(params.full);
    -859         } else {
    -860             throw new Error("This class supports GeneralNames only as argument");
    -861         }
    -862     }
    -863 };
    -864 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object);
    -865 
    -866 /**
    -867  * CertificatePolicies ASN.1 structure class
    -868  * @name KJUR.asn1.x509.CertificatePolicies
    -869  * @class CertificatePolicies ASN.1 structure class
    -870  * @param {Array} params associative array of parameters
    -871  * @extends KJUR.asn1.x509.Extension
    -872  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -873  * @see KJUR.asn1.x509.CertificatePolicies
    -874  * @see KJUR.asn1.x509.PolicyInformation
    -875  * @see KJUR.asn1.x509.PolicyQualifierInfo
    -876  * @see KJUR.asn1.x509.UserNotice
    -877  * @see KJUR.asn1.x509.NoticeReference
    -878  * @see KJUR.asn1.x509.DisplayText
    -879  * @description
    -880  * This class represents 
    -881  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -882  * CertificatePolicies extension defined in RFC 5280 4.2.1.4</a>.
    -883  * <pre>
    -884  * id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }
    -885  * CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
    -886  * </pre>
    -887  * Its constructor can have following parameters:
    -888  * <ul>
    -889  * <li>array - array of {@link KJUR.asn1.x509.PolicyInformation} parameter</li>
    -890  * <li>critical - boolean: critical flag</li>
    -891  * </ul>
    -892  * NOTE: Returned JSON value format have been changed without 
    -893  * backward compatibility since jsrsasign 9.0.0 asn1x509 2.0.0.
    -894  * @example
    -895  * e1 = new KJUR.asn1.x509.CertificatePolicies({
    -896  *   array: [
    -897  *     { policyoid: "1.2.3.4.5",
    -898  *       array: [
    -899  *         { cps: "https://example.com/repository" },
    -900  *         { unotice: {
    -901  *           noticeref: { // CA SHOULD NOT use this by RFC
    -902  *             org: {type: "ia5", str: "Sample Org"},
    -903  *             noticenum: [{int: 5}, {hex: "01af"}]
    -904  *           },
    -905  *           exptext: {type: "ia5", str: "Sample Policy"}
    -906  *         }}
    -907  *       ]
    -908  *     }
    -909  *   ],
    -910  *   critical: true
    -911  * });
    -912  */
    -913 KJUR.asn1.x509.CertificatePolicies = function(params) {
    -914     KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this, params);
    -915     var _KJUR = KJUR,
    -916 	_KJUR_asn1 = _KJUR.asn1,
    -917 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -918 	_DERSequence = _KJUR_asn1.DERSequence,
    -919 	_PolicyInformation = _KJUR_asn1_x509.PolicyInformation;
    -920 
    -921     this.params = null;
    +762  *   {dpname: {full: [{uri: "http://example.com/crl1.crl"}]}})
    +763  * new KJUR.asn1.x509.DistributionPoint(
    +764  *   {dpobj: new DistributionPoint(...)})
    +765  */
    +766 KJUR.asn1.x509.DistributionPoint = function(params) {
    +767     KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this);
    +768     var asn1DP = null,
    +769 	_KJUR = KJUR,
    +770 	_KJUR_asn1 = _KJUR.asn1,
    +771 	_DistributionPointName = _KJUR_asn1.x509.DistributionPointName;
    +772 
    +773     this.getEncodedHex = function() {
    +774         var seq = new _KJUR_asn1.DERSequence();
    +775         if (this.asn1DP != null) {
    +776             var o1 = new _KJUR_asn1.DERTaggedObject({'explicit': true,
    +777                                                      'tag': 'a0',
    +778                                                      'obj': this.asn1DP});
    +779             seq.appendASN1Object(o1);
    +780         }
    +781         this.hTLV = seq.getEncodedHex();
    +782         return this.hTLV;
    +783     };
    +784 
    +785     if (params !== undefined) {
    +786         if (params.dpobj !== undefined) {
    +787             this.asn1DP = params.dpobj;
    +788         } else if (params.dpname !== undefined) {
    +789             this.asn1DP = new _DistributionPointName(params.dpname);
    +790 	} else if (params.fulluri !== undefined) {
    +791             this.asn1DP = new _DistributionPointName({full: [{uri: params.fulluri}]});
    +792 	}
    +793     }
    +794 };
    +795 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object);
    +796 
    +797 /**
    +798  * DistributionPointName ASN.1 structure class<br/>
    +799  * @name KJUR.asn1.x509.DistributionPointName
    +800  * @class DistributionPointName ASN.1 structure class
    +801  * @param {Array} params JSON object of parameters or GeneralNames object
    +802  * @extends KJUR.asn1.ASN1Object
    +803  * @see {@link KJUR.asn1.x509.CRLDistributionPoints}
    +804  * @see {@link KJUR.asn1.x509.DistributionPoint}
    +805  * @see {@link KJUR.asn1.x509.GeneralNames}
    +806  * @see {@link X509#getDistributionPointName}
    +807  * @description
    +808  * This class represents 
    +809  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.13">
    +810  * DistributionPointName defined in RFC 5280 4.2.1.13</a>.
    +811  * <pre>
    +812  * DistributionPointName ::= CHOICE {
    +813  *      fullName                [0]     GeneralNames,
    +814  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    +815  * </pre>
    +816  * Constructor can have following parameter:
    +817  * <ul>
    +818  * <li>{String}full - JSON object parameter of {@link KJUR.asn1.x509.GeneralNames} for 'fullName' field</li>
    +819  * <li>{GeneralNames} - {@link KJUR.asn1.x509.GeneralNames} object for 'fullName'</li>
    +820  * </ul>
    +821  * NOTE1: 'full' parameter have been suppored since jsrsasign 9.0.0 asn1x509 2.0.0.
    +822  * <br>
    +823  * NOTE2: The 'nameRelativeToCRLIssuer' field is currently not supported.
    +824  * @example
    +825  * new KJUR.asn1.x509.DistributionPointName({full: <<GeneralNamesParameter>>})
    +826  * new KJUR.asn1.x509.DistributionPointName({full: [{uri: <<CDPURI>>}]})
    +827  * new KJUR.asn1.x509.DistributionPointName({full: [{dn: <<DN Parameter>>}]}
    +828  * new KJUR.asn1.x509.DistributionPointName({full: [{uri: "http://example.com/root.crl"}]})
    +829  * new KJUR.asn1.x509.DistributionPointName({full: [{dn {str: "/C=US/O=Test"}}]})
    +830  * new KJUR.asn1.x509.DistributionPointName(new GeneralNames(...))
    +831  */
    +832 KJUR.asn1.x509.DistributionPointName = function(params) {
    +833     KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this);
    +834     var asn1Obj = null,
    +835 	type = null,
    +836 	tag = null,
    +837 	asn1V = null,
    +838 	_KJUR = KJUR,
    +839 	_KJUR_asn1 = _KJUR.asn1,
    +840 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject;
    +841 
    +842     this.getEncodedHex = function() {
    +843         if (this.type != "full")
    +844             throw new Error("currently type shall be 'full': " + this.type);
    +845         this.asn1Obj = new _DERTaggedObject({'explicit': false,
    +846                                              'tag': this.tag,
    +847                                              'obj': this.asn1V});
    +848         this.hTLV = this.asn1Obj.getEncodedHex();
    +849         return this.hTLV;
    +850     };
    +851 
    +852     if (params !== undefined) {
    +853         if (_KJUR_asn1.x509.GeneralNames.prototype.isPrototypeOf(params)) {
    +854             this.type = "full";
    +855             this.tag = "a0";
    +856             this.asn1V = params;
    +857 	} else if (params.full !== undefined) {
    +858             this.type = "full";
    +859             this.tag = "a0";
    +860             this.asn1V = new _KJUR_asn1.x509.GeneralNames(params.full);
    +861         } else {
    +862             throw new Error("This class supports GeneralNames only as argument");
    +863         }
    +864     }
    +865 };
    +866 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object);
    +867 
    +868 /**
    +869  * CertificatePolicies ASN.1 structure class
    +870  * @name KJUR.asn1.x509.CertificatePolicies
    +871  * @class CertificatePolicies ASN.1 structure class
    +872  * @param {Array} params associative array of parameters
    +873  * @extends KJUR.asn1.x509.Extension
    +874  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +875  * @see KJUR.asn1.x509.CertificatePolicies
    +876  * @see KJUR.asn1.x509.PolicyInformation
    +877  * @see KJUR.asn1.x509.PolicyQualifierInfo
    +878  * @see KJUR.asn1.x509.UserNotice
    +879  * @see KJUR.asn1.x509.NoticeReference
    +880  * @see KJUR.asn1.x509.DisplayText
    +881  * @description
    +882  * This class represents 
    +883  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +884  * CertificatePolicies extension defined in RFC 5280 4.2.1.4</a>.
    +885  * <pre>
    +886  * id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }
    +887  * CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
    +888  * </pre>
    +889  * Its constructor can have following parameters:
    +890  * <ul>
    +891  * <li>array - array of {@link KJUR.asn1.x509.PolicyInformation} parameter</li>
    +892  * <li>critical - boolean: critical flag</li>
    +893  * </ul>
    +894  * NOTE: Returned JSON value format have been changed without 
    +895  * backward compatibility since jsrsasign 9.0.0 asn1x509 2.0.0.
    +896  * @example
    +897  * e1 = new KJUR.asn1.x509.CertificatePolicies({
    +898  *   array: [
    +899  *     { policyoid: "1.2.3.4.5",
    +900  *       array: [
    +901  *         { cps: "https://example.com/repository" },
    +902  *         { unotice: {
    +903  *           noticeref: { // CA SHOULD NOT use this by RFC
    +904  *             org: {type: "ia5", str: "Sample Org"},
    +905  *             noticenum: [{int: 5}, {hex: "01af"}]
    +906  *           },
    +907  *           exptext: {type: "ia5", str: "Sample Policy"}
    +908  *         }}
    +909  *       ]
    +910  *     }
    +911  *   ],
    +912  *   critical: true
    +913  * });
    +914  */
    +915 KJUR.asn1.x509.CertificatePolicies = function(params) {
    +916     KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this, params);
    +917     var _KJUR = KJUR,
    +918 	_KJUR_asn1 = _KJUR.asn1,
    +919 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +920 	_DERSequence = _KJUR_asn1.DERSequence,
    +921 	_PolicyInformation = _KJUR_asn1_x509.PolicyInformation;
     922 
    -923     this.getExtnValueHex = function() {
    -924 	var aPI = [];
    -925 	for (var i = 0; i < this.params.array.length; i++) {
    -926 	    aPI.push(new _PolicyInformation(this.params.array[i]));
    -927 	}
    -928 	var seq = new _DERSequence({array: aPI});
    -929 	this.asn1ExtnValue = seq;
    -930         return this.asn1ExtnValue.getEncodedHex();
    -931     };
    -932 
    -933     this.oid = "2.5.29.32";
    -934     if (params !== undefined) {
    -935 	this.params = params;
    -936     }
    -937 };
    -938 YAHOO.lang.extend(KJUR.asn1.x509.CertificatePolicies, KJUR.asn1.x509.Extension);
    -939 
    -940 // ===== BEGIN CertificatePolicies related classes =====
    -941 /**
    -942  * PolicyInformation ASN.1 structure class
    -943  * @name KJUR.asn1.x509.PolicyInformation
    -944  * @class PolicyInformation ASN.1 structure class
    -945  * @param {Array} params JSON object of parameters
    -946  * @extends KJUR.asn1.ASN1Object
    -947  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -948  * @see KJUR.asn1.x509.CertificatePolicies
    -949  * @see KJUR.asn1.x509.PolicyInformation
    -950  * @see KJUR.asn1.x509.PolicyQualifierInfo
    -951  * @see KJUR.asn1.x509.UserNotice
    -952  * @see KJUR.asn1.x509.NoticeReference
    -953  * @see KJUR.asn1.x509.DisplayText
    -954  * @description
    -955  * This class represents 
    -956  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -957  * PolicyInformation defined in RFC 5280 4.2.1.4</a>.
    -958  * <pre>
    -959  * PolicyInformation ::= SEQUENCE {
    -960  *      policyIdentifier   CertPolicyId,
    -961  *      policyQualifiers   SEQUENCE SIZE (1..MAX) OF
    -962  *                         PolicyQualifierInfo OPTIONAL }
    -963  * CertPolicyId ::= OBJECT IDENTIFIER
    -964  * Its constructor can have following parameters:
    -965  * <ul>
    -966  * <li>{String}policyoid - policy OID (ex. "1.2.3.4.5")</li>
    -967  * <li>{Object}array - array of {@link KJUR.asn1.x509.PolicyQualifierInfo}
    -968  * parameters (OPTIONAL)</li>
    -969  * </ul>
    -970  * @example
    -971  * new KJUR.asn1.x509.PolicyInformation({
    -972  *   policyoid: "1.2.3.4.5",
    -973  *   array: [
    -974  *     { cps: "https://example.com/repository" },
    -975  *     { unotice: {
    -976  *       noticeref: { // CA SHOULD NOT use this by RFC
    -977  *         org: {type: "ia5", str: "Sample Org"},
    -978  *         noticenum: [{int: 5}, {hex: "01af"}]
    -979  *       },
    -980  *       exptext: {type: "ia5", str: "Sample Policy"}
    -981  *     }}
    -982  *   ]
    -983  * })
    -984  */
    -985 KJUR.asn1.x509.PolicyInformation = function(params) {
    -986     KJUR.asn1.x509.PolicyInformation.superclass.constructor.call(this,
    -987 								 params);
    -988     var _KJUR_asn1 = KJUR.asn1,
    -989 	_DERSequence = _KJUR_asn1.DERSequence,
    -990 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -991 	_PolicyQualifierInfo = _KJUR_asn1.x509.PolicyQualifierInfo;
    -992 
    -993     this.params = null;
    +923     this.params = null;
    +924 
    +925     this.getExtnValueHex = function() {
    +926 	var aPI = [];
    +927 	for (var i = 0; i < this.params.array.length; i++) {
    +928 	    aPI.push(new _PolicyInformation(this.params.array[i]));
    +929 	}
    +930 	var seq = new _DERSequence({array: aPI});
    +931 	this.asn1ExtnValue = seq;
    +932         return this.asn1ExtnValue.getEncodedHex();
    +933     };
    +934 
    +935     this.oid = "2.5.29.32";
    +936     if (params !== undefined) {
    +937 	this.params = params;
    +938     }
    +939 };
    +940 YAHOO.lang.extend(KJUR.asn1.x509.CertificatePolicies, KJUR.asn1.x509.Extension);
    +941 
    +942 // ===== BEGIN CertificatePolicies related classes =====
    +943 /**
    +944  * PolicyInformation ASN.1 structure class
    +945  * @name KJUR.asn1.x509.PolicyInformation
    +946  * @class PolicyInformation ASN.1 structure class
    +947  * @param {Array} params JSON object of parameters
    +948  * @extends KJUR.asn1.ASN1Object
    +949  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +950  * @see KJUR.asn1.x509.CertificatePolicies
    +951  * @see KJUR.asn1.x509.PolicyInformation
    +952  * @see KJUR.asn1.x509.PolicyQualifierInfo
    +953  * @see KJUR.asn1.x509.UserNotice
    +954  * @see KJUR.asn1.x509.NoticeReference
    +955  * @see KJUR.asn1.x509.DisplayText
    +956  * @description
    +957  * This class represents 
    +958  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +959  * PolicyInformation defined in RFC 5280 4.2.1.4</a>.
    +960  * <pre>
    +961  * PolicyInformation ::= SEQUENCE {
    +962  *      policyIdentifier   CertPolicyId,
    +963  *      policyQualifiers   SEQUENCE SIZE (1..MAX) OF
    +964  *                         PolicyQualifierInfo OPTIONAL }
    +965  * CertPolicyId ::= OBJECT IDENTIFIER
    +966  * Its constructor can have following parameters:
    +967  * <ul>
    +968  * <li>{String}policyoid - policy OID (ex. "1.2.3.4.5")</li>
    +969  * <li>{Object}array - array of {@link KJUR.asn1.x509.PolicyQualifierInfo}
    +970  * parameters (OPTIONAL)</li>
    +971  * </ul>
    +972  * @example
    +973  * new KJUR.asn1.x509.PolicyInformation({
    +974  *   policyoid: "1.2.3.4.5",
    +975  *   array: [
    +976  *     { cps: "https://example.com/repository" },
    +977  *     { unotice: {
    +978  *       noticeref: { // CA SHOULD NOT use this by RFC
    +979  *         org: {type: "ia5", str: "Sample Org"},
    +980  *         noticenum: [{int: 5}, {hex: "01af"}]
    +981  *       },
    +982  *       exptext: {type: "ia5", str: "Sample Policy"}
    +983  *     }}
    +984  *   ]
    +985  * })
    +986  */
    +987 KJUR.asn1.x509.PolicyInformation = function(params) {
    +988     KJUR.asn1.x509.PolicyInformation.superclass.constructor.call(this,
    +989 								 params);
    +990     var _KJUR_asn1 = KJUR.asn1,
    +991 	_DERSequence = _KJUR_asn1.DERSequence,
    +992 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +993 	_PolicyQualifierInfo = _KJUR_asn1.x509.PolicyQualifierInfo;
     994 
    -995     this.getEncodedHex = function() {
    -996 	if (this.params.policyoid === undefined &&
    -997 	    this.params.array === undefined)
    -998 	    throw new Error("parameter oid and array missing");
    -999 
    -1000 	// policy oid
    -1001 	var a = [new _DERObjectIdentifier(this.params.policyoid)];
    -1002 
    -1003 	// array of ASN1Object of PolicyQualifierInfo
    -1004 	if (this.params.array !== undefined) {
    -1005 	    var aPQI = [];
    -1006 	    for (var i = 0; i < this.params.array.length; i++) {
    -1007 		aPQI.push(new _PolicyQualifierInfo(this.params.array[i]));
    -1008 	    }
    -1009 	    if (aPQI.length > 0) {
    -1010 		a.push(new _DERSequence({array: aPQI}));
    -1011 	    }
    -1012 	}
    -1013 
    -1014 	var seq = new _DERSequence({array: a});
    -1015 	return seq.getEncodedHex();
    -1016     };
    -1017 
    -1018     if (params !== undefined) {
    -1019 	this.params = params;
    -1020     }
    -1021 };
    -1022 YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation, KJUR.asn1.ASN1Object);
    -1023 
    -1024 /**
    -1025  * PolicyQualifierInfo ASN.1 structure class
    -1026  * @name KJUR.asn1.x509.PolicyQualifierInfo
    -1027  * @class PolicyQualifierInfo ASN.1 structure class
    -1028  * @param {Array} params associative array of parameters
    -1029  * @extends KJUR.asn1.ASN1Object
    -1030  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -1031  * @description
    -1032  * This class represents 
    -1033  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -1034  * PolicyQualifierInfo defined in RFC 5280 4.2.1.4</a>.
    -1035  * <pre>
    -1036  * PolicyQualifierInfo ::= SEQUENCE {
    -1037  *      policyQualifierId  PolicyQualifierId,
    -1038  *      qualifier          ANY DEFINED BY policyQualifierId }
    -1039  * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    -1040  * CPSuri ::= IA5String
    -1041  * </pre>
    -1042  * Its constructor can have one of following two parameters:
    -1043  * <ul>
    -1044  * <li>{String}cps - URI string for CPS</li>
    -1045  * <li>{Object}unotice - {@link KJUR.asn1.x509.UserNotice} parameter</li>
    -1046  * </ul>
    -1047  * @example
    -1048  * new PolicyQualifierInfo({
    -1049  *   cps: "https://example.com/repository/cps"
    -1050  * })
    -1051  *
    -1052  * new PolicyQualifierInfo({
    -1053  *   unotice: {
    -1054  *     noticeref: { // CA SHOULD NOT use this by RFC
    -1055  *       org: {type: "bmp", str: "Sample Org"},
    -1056  *       noticenum: [{int: 3}, {hex: "01af"}]
    -1057  *     },
    -1058  *     exptext: {type: "ia5", str: "Sample Policy"}
    -1059  *   }
    -1060  * })
    -1061  */
    -1062 KJUR.asn1.x509.PolicyQualifierInfo = function(params) {
    -1063     KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,
    -1064 								   params);
    -1065     var _KJUR_asn1 = KJUR.asn1,
    -1066 	_DERSequence = _KJUR_asn1.DERSequence,
    -1067 	_DERIA5String = _KJUR_asn1.DERIA5String,
    -1068 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -1069 	_UserNotice = _KJUR_asn1.x509.UserNotice;
    -1070 
    -1071     this.params = null;
    +995     this.params = null;
    +996 
    +997     this.getEncodedHex = function() {
    +998 	if (this.params.policyoid === undefined &&
    +999 	    this.params.array === undefined)
    +1000 	    throw new Error("parameter oid and array missing");
    +1001 
    +1002 	// policy oid
    +1003 	var a = [new _DERObjectIdentifier(this.params.policyoid)];
    +1004 
    +1005 	// array of ASN1Object of PolicyQualifierInfo
    +1006 	if (this.params.array !== undefined) {
    +1007 	    var aPQI = [];
    +1008 	    for (var i = 0; i < this.params.array.length; i++) {
    +1009 		aPQI.push(new _PolicyQualifierInfo(this.params.array[i]));
    +1010 	    }
    +1011 	    if (aPQI.length > 0) {
    +1012 		a.push(new _DERSequence({array: aPQI}));
    +1013 	    }
    +1014 	}
    +1015 
    +1016 	var seq = new _DERSequence({array: a});
    +1017 	return seq.getEncodedHex();
    +1018     };
    +1019 
    +1020     if (params !== undefined) {
    +1021 	this.params = params;
    +1022     }
    +1023 };
    +1024 YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation, KJUR.asn1.ASN1Object);
    +1025 
    +1026 /**
    +1027  * PolicyQualifierInfo ASN.1 structure class
    +1028  * @name KJUR.asn1.x509.PolicyQualifierInfo
    +1029  * @class PolicyQualifierInfo ASN.1 structure class
    +1030  * @param {Array} params associative array of parameters
    +1031  * @extends KJUR.asn1.ASN1Object
    +1032  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1033  * @description
    +1034  * This class represents 
    +1035  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1036  * PolicyQualifierInfo defined in RFC 5280 4.2.1.4</a>.
    +1037  * <pre>
    +1038  * PolicyQualifierInfo ::= SEQUENCE {
    +1039  *      policyQualifierId  PolicyQualifierId,
    +1040  *      qualifier          ANY DEFINED BY policyQualifierId }
    +1041  * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    +1042  * CPSuri ::= IA5String
    +1043  * </pre>
    +1044  * Its constructor can have one of following two parameters:
    +1045  * <ul>
    +1046  * <li>{String}cps - URI string for CPS</li>
    +1047  * <li>{Object}unotice - {@link KJUR.asn1.x509.UserNotice} parameter</li>
    +1048  * </ul>
    +1049  * @example
    +1050  * new PolicyQualifierInfo({
    +1051  *   cps: "https://example.com/repository/cps"
    +1052  * })
    +1053  *
    +1054  * new PolicyQualifierInfo({
    +1055  *   unotice: {
    +1056  *     noticeref: { // CA SHOULD NOT use this by RFC
    +1057  *       org: {type: "bmp", str: "Sample Org"},
    +1058  *       noticenum: [{int: 3}, {hex: "01af"}]
    +1059  *     },
    +1060  *     exptext: {type: "ia5", str: "Sample Policy"}
    +1061  *   }
    +1062  * })
    +1063  */
    +1064 KJUR.asn1.x509.PolicyQualifierInfo = function(params) {
    +1065     KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,
    +1066 								   params);
    +1067     var _KJUR_asn1 = KJUR.asn1,
    +1068 	_DERSequence = _KJUR_asn1.DERSequence,
    +1069 	_DERIA5String = _KJUR_asn1.DERIA5String,
    +1070 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +1071 	_UserNotice = _KJUR_asn1.x509.UserNotice;
     1072 
    -1073     this.getEncodedHex = function() {
    -1074 	if (this.params.cps !== undefined) {
    -1075 	    var seq = new _DERSequence({array: [
    -1076 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.1'}),
    -1077 		new _DERIA5String({str: this.params.cps})
    -1078 	    ]});
    -1079 	    return seq.getEncodedHex();
    -1080 	}
    -1081 	if (this.params.unotice != undefined) {
    -1082 	    var seq = new _DERSequence({array: [
    -1083 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.2'}),
    -1084 		new _UserNotice(this.params.unotice)
    -1085 	    ]});
    -1086 	    return seq.getEncodedHex();
    -1087 	}
    -1088     };
    -1089 
    -1090     if (params !== undefined) {
    -1091 	this.params = params;
    -1092     }
    -1093 };
    -1094 YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo, KJUR.asn1.ASN1Object);
    -1095 
    -1096 
    -1097 /**
    -1098  * UserNotice ASN.1 structure class
    -1099  * @name KJUR.asn1.x509.UserNotice
    -1100  * @class UserNotice ASN.1 structure class
    -1101  * @param {Array} params associative array of parameters
    -1102  * @extends KJUR.asn1.ASN1Object
    -1103  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -1104  * @description
    -1105  * This class represents 
    -1106  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -1107  * UserNotice defined in RFC 5280 4.2.1.4</a>.
    -1108  * <pre>
    -1109  * UserNotice ::= SEQUENCE {
    -1110  *      noticeRef        NoticeReference OPTIONAL,
    -1111  *      explicitText     DisplayText OPTIONAL }
    -1112  * </pre>
    -1113  * Its constructor can have following two parameters:
    -1114  * <ul>
    -1115  * <li>{Object}noticeref - {@link KJUR.asn1.x509.NoticeReference} parameter.
    -1116  * This SHALL NOT be set for conforming CA by RFC 5280. (OPTIONAL)</li>
    -1117  * <li>{Object}exptext - explicitText value
    -1118  * by {@link KJUR.asn1.x509.DisplayText} parameter (OPTIONAL)</li>
    -1119  * </ul>
    -1120  * @example
    -1121  * new UserNotice({
    -1122  *   noticeref: {
    -1123  *     org: {type: "bmp", str: "Sample Org"},
    -1124  *     noticenum: [{int: 3}, {hex: "01af"}]
    -1125  *   },
    -1126  *   exptext: {type: "ia5", str: "Sample Policy"}
    -1127  * })
    -1128  */
    -1129 KJUR.asn1.x509.UserNotice = function(params) {
    -1130     KJUR.asn1.x509.UserNotice.superclass.constructor.call(this, params);
    -1131     var _DERSequence = KJUR.asn1.DERSequence,
    -1132 	_DERInteger = KJUR.asn1.DERInteger,
    -1133 	_DisplayText = KJUR.asn1.x509.DisplayText,
    -1134 	_NoticeReference = KJUR.asn1.x509.NoticeReference;
    -1135 
    -1136     this.params = null;
    +1073     this.params = null;
    +1074 
    +1075     this.getEncodedHex = function() {
    +1076 	if (this.params.cps !== undefined) {
    +1077 	    var seq = new _DERSequence({array: [
    +1078 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.1'}),
    +1079 		new _DERIA5String({str: this.params.cps})
    +1080 	    ]});
    +1081 	    return seq.getEncodedHex();
    +1082 	}
    +1083 	if (this.params.unotice != undefined) {
    +1084 	    var seq = new _DERSequence({array: [
    +1085 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.2'}),
    +1086 		new _UserNotice(this.params.unotice)
    +1087 	    ]});
    +1088 	    return seq.getEncodedHex();
    +1089 	}
    +1090     };
    +1091 
    +1092     if (params !== undefined) {
    +1093 	this.params = params;
    +1094     }
    +1095 };
    +1096 YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo, KJUR.asn1.ASN1Object);
    +1097 
    +1098 
    +1099 /**
    +1100  * UserNotice ASN.1 structure class
    +1101  * @name KJUR.asn1.x509.UserNotice
    +1102  * @class UserNotice ASN.1 structure class
    +1103  * @param {Array} params associative array of parameters
    +1104  * @extends KJUR.asn1.ASN1Object
    +1105  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1106  * @description
    +1107  * This class represents 
    +1108  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1109  * UserNotice defined in RFC 5280 4.2.1.4</a>.
    +1110  * <pre>
    +1111  * UserNotice ::= SEQUENCE {
    +1112  *      noticeRef        NoticeReference OPTIONAL,
    +1113  *      explicitText     DisplayText OPTIONAL }
    +1114  * </pre>
    +1115  * Its constructor can have following two parameters:
    +1116  * <ul>
    +1117  * <li>{Object}noticeref - {@link KJUR.asn1.x509.NoticeReference} parameter.
    +1118  * This SHALL NOT be set for conforming CA by RFC 5280. (OPTIONAL)</li>
    +1119  * <li>{Object}exptext - explicitText value
    +1120  * by {@link KJUR.asn1.x509.DisplayText} parameter (OPTIONAL)</li>
    +1121  * </ul>
    +1122  * @example
    +1123  * new UserNotice({
    +1124  *   noticeref: {
    +1125  *     org: {type: "bmp", str: "Sample Org"},
    +1126  *     noticenum: [{int: 3}, {hex: "01af"}]
    +1127  *   },
    +1128  *   exptext: {type: "ia5", str: "Sample Policy"}
    +1129  * })
    +1130  */
    +1131 KJUR.asn1.x509.UserNotice = function(params) {
    +1132     KJUR.asn1.x509.UserNotice.superclass.constructor.call(this, params);
    +1133     var _DERSequence = KJUR.asn1.DERSequence,
    +1134 	_DERInteger = KJUR.asn1.DERInteger,
    +1135 	_DisplayText = KJUR.asn1.x509.DisplayText,
    +1136 	_NoticeReference = KJUR.asn1.x509.NoticeReference;
     1137 
    -1138     this.getEncodedHex = function() {
    -1139 	var a = [];
    -1140 	if (this.params.noticeref !== undefined) {
    -1141 	    a.push(new _NoticeReference(this.params.noticeref));
    -1142 	}
    -1143 	if (this.params.exptext !== undefined) {
    -1144 	    a.push(new _DisplayText(this.params.exptext));
    -1145 	}
    -1146 	var seq = new _DERSequence({array: a});
    -1147 	return seq.getEncodedHex();
    -1148     };
    -1149 
    -1150     if (params !== undefined) {
    -1151 	this.params = params;
    -1152     }
    -1153 };
    -1154 YAHOO.lang.extend(KJUR.asn1.x509.UserNotice, KJUR.asn1.ASN1Object);
    -1155 
    -1156 /**
    -1157  * NoticeReference ASN.1 structure class
    -1158  * @name KJUR.asn1.x509.NoticeReference
    -1159  * @class NoticeReference ASN.1 structure class
    -1160  * @param {Array} params associative array of parameters
    -1161  * @extends KJUR.asn1.ASN1Object
    -1162  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -1163  * @description
    -1164  * This class represents 
    -1165  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -1166  * NoticeReference defined in RFC 5280 4.2.1.4</a>.
    -1167  * <pre>
    -1168  * NoticeReference ::= SEQUENCE {
    -1169  *      organization     DisplayText,
    -1170  *      noticeNumbers    SEQUENCE OF INTEGER }
    -1171  * </pre>
    -1172  * Its constructor can have following two parameters:
    -1173  * <ul>
    -1174  * <li>{Object}org - organization by {@link KJUR.asn1.x509.DisplayText}
    -1175  * parameter.</li>
    -1176  * <li>{Object}noticenum - noticeNumbers value by an array of
    -1177  * {@link KJUR.asn1.DERInteger} parameter</li>
    -1178  * </ul>
    -1179  * @example
    -1180  * new NoticeReference({
    -1181  *   org: {type: "bmp", str: "Sample Org"},
    -1182  *   noticenum: [{int: 3}, {hex: "01af"}]
    -1183  * })
    -1184  */
    -1185 KJUR.asn1.x509.NoticeReference = function(params) {
    -1186     KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this, params);
    -1187     var _DERSequence = KJUR.asn1.DERSequence,
    -1188 	_DERInteger = KJUR.asn1.DERInteger,
    -1189 	_DisplayText = KJUR.asn1.x509.DisplayText;
    -1190 
    -1191     this.params = null;
    +1138     this.params = null;
    +1139 
    +1140     this.getEncodedHex = function() {
    +1141 	var a = [];
    +1142 	if (this.params.noticeref !== undefined) {
    +1143 	    a.push(new _NoticeReference(this.params.noticeref));
    +1144 	}
    +1145 	if (this.params.exptext !== undefined) {
    +1146 	    a.push(new _DisplayText(this.params.exptext));
    +1147 	}
    +1148 	var seq = new _DERSequence({array: a});
    +1149 	return seq.getEncodedHex();
    +1150     };
    +1151 
    +1152     if (params !== undefined) {
    +1153 	this.params = params;
    +1154     }
    +1155 };
    +1156 YAHOO.lang.extend(KJUR.asn1.x509.UserNotice, KJUR.asn1.ASN1Object);
    +1157 
    +1158 /**
    +1159  * NoticeReference ASN.1 structure class
    +1160  * @name KJUR.asn1.x509.NoticeReference
    +1161  * @class NoticeReference ASN.1 structure class
    +1162  * @param {Array} params associative array of parameters
    +1163  * @extends KJUR.asn1.ASN1Object
    +1164  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1165  * @description
    +1166  * This class represents 
    +1167  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1168  * NoticeReference defined in RFC 5280 4.2.1.4</a>.
    +1169  * <pre>
    +1170  * NoticeReference ::= SEQUENCE {
    +1171  *      organization     DisplayText,
    +1172  *      noticeNumbers    SEQUENCE OF INTEGER }
    +1173  * </pre>
    +1174  * Its constructor can have following two parameters:
    +1175  * <ul>
    +1176  * <li>{Object}org - organization by {@link KJUR.asn1.x509.DisplayText}
    +1177  * parameter.</li>
    +1178  * <li>{Object}noticenum - noticeNumbers value by an array of
    +1179  * {@link KJUR.asn1.DERInteger} parameter</li>
    +1180  * </ul>
    +1181  * @example
    +1182  * new NoticeReference({
    +1183  *   org: {type: "bmp", str: "Sample Org"},
    +1184  *   noticenum: [{int: 3}, {hex: "01af"}]
    +1185  * })
    +1186  */
    +1187 KJUR.asn1.x509.NoticeReference = function(params) {
    +1188     KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this, params);
    +1189     var _DERSequence = KJUR.asn1.DERSequence,
    +1190 	_DERInteger = KJUR.asn1.DERInteger,
    +1191 	_DisplayText = KJUR.asn1.x509.DisplayText;
     1192 
    -1193     this.getEncodedHex = function() {
    -1194 	var a = [];
    -1195 	if (this.params.org !== undefined) {
    -1196 	    a.push(new _DisplayText(this.params.org));
    -1197 	}
    -1198 	if (this.params.noticenum !== undefined) {
    -1199 	    var aNoticeNum = [];
    -1200 	    var aNumParam = this.params.noticenum;
    -1201 	    for (var i = 0; i < aNumParam.length; i++) {
    -1202 		aNoticeNum.push(new _DERInteger(aNumParam[i]));
    -1203 	    }
    -1204 	    a.push(new _DERSequence({array: aNoticeNum}));
    -1205 	}
    -1206 	if (a.length == 0) throw new Error("parameter is empty");
    -1207 	var seq = new _DERSequence({array: a});
    -1208 	return seq.getEncodedHex();
    -1209     }
    -1210 
    -1211     if (params !== undefined) {
    -1212 	this.params = params;
    -1213     }
    -1214 };
    -1215 YAHOO.lang.extend(KJUR.asn1.x509.NoticeReference, KJUR.asn1.ASN1Object);
    -1216 
    -1217 /**
    -1218  * DisplayText ASN.1 structure class
    -1219  * @name KJUR.asn1.x509.DisplayText
    -1220  * @class DisplayText ASN.1 structure class
    -1221  * @param {Array} params associative array of parameters
    -1222  * @extends KJUR.asn1.DERAbstractString
    -1223  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    -1224  * @description
    -1225  * This class represents 
    -1226  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    -1227  * DisplayText defined in RFC 5280 4.2.1.4</a>.
    -1228  * <pre>
    -1229  * -- from RFC 5280 Appendix A
    -1230  * DisplayText ::= CHOICE {
    -1231  *      ia5String        IA5String      (SIZE (1..200)),
    -1232  *      visibleString    VisibleString  (SIZE (1..200)),
    -1233  *      bmpString        BMPString      (SIZE (1..200)),
    -1234  *      utf8String       UTF8String     (SIZE (1..200)) }
    -1235  * </pre>
    -1236  * {@link KJUR.asn1.DERAbstractString} parameters and methods
    -1237  * can be used.
    -1238  * Its constructor can also have following parameter:
    -1239  * <ul>
    -1240  * <li>{String} type - DirectoryString type of DisplayText.
    -1241  * "ia5" for IA5String, "vis" for VisibleString,
    -1242  * "bmp" for BMPString and "utf8" for UTF8String.
    -1243  * Default is "utf8". (OPTIONAL)</li>
    -1244  * </ul>
    -1245  * @example
    -1246  * new DisplayText({type: "bmp", str: "Sample Org"})
    -1247  * new DisplayText({type: "ia5", str: "Sample Org"})
    -1248  * new DisplayText({str: "Sample Org"})
    -1249  */
    -1250 KJUR.asn1.x509.DisplayText = function(params) {
    -1251     KJUR.asn1.x509.DisplayText.superclass.constructor.call(this, params);
    -1252 
    -1253     this.hT = "0c"; // DEFAULT "utf8"
    +1193     this.params = null;
    +1194 
    +1195     this.getEncodedHex = function() {
    +1196 	var a = [];
    +1197 	if (this.params.org !== undefined) {
    +1198 	    a.push(new _DisplayText(this.params.org));
    +1199 	}
    +1200 	if (this.params.noticenum !== undefined) {
    +1201 	    var aNoticeNum = [];
    +1202 	    var aNumParam = this.params.noticenum;
    +1203 	    for (var i = 0; i < aNumParam.length; i++) {
    +1204 		aNoticeNum.push(new _DERInteger(aNumParam[i]));
    +1205 	    }
    +1206 	    a.push(new _DERSequence({array: aNoticeNum}));
    +1207 	}
    +1208 	if (a.length == 0) throw new Error("parameter is empty");
    +1209 	var seq = new _DERSequence({array: a});
    +1210 	return seq.getEncodedHex();
    +1211     }
    +1212 
    +1213     if (params !== undefined) {
    +1214 	this.params = params;
    +1215     }
    +1216 };
    +1217 YAHOO.lang.extend(KJUR.asn1.x509.NoticeReference, KJUR.asn1.ASN1Object);
    +1218 
    +1219 /**
    +1220  * DisplayText ASN.1 structure class
    +1221  * @name KJUR.asn1.x509.DisplayText
    +1222  * @class DisplayText ASN.1 structure class
    +1223  * @param {Array} params associative array of parameters
    +1224  * @extends KJUR.asn1.DERAbstractString
    +1225  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1226  * @description
    +1227  * This class represents 
    +1228  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1229  * DisplayText defined in RFC 5280 4.2.1.4</a>.
    +1230  * <pre>
    +1231  * -- from RFC 5280 Appendix A
    +1232  * DisplayText ::= CHOICE {
    +1233  *      ia5String        IA5String      (SIZE (1..200)),
    +1234  *      visibleString    VisibleString  (SIZE (1..200)),
    +1235  *      bmpString        BMPString      (SIZE (1..200)),
    +1236  *      utf8String       UTF8String     (SIZE (1..200)) }
    +1237  * </pre>
    +1238  * {@link KJUR.asn1.DERAbstractString} parameters and methods
    +1239  * can be used.
    +1240  * Its constructor can also have following parameter:
    +1241  * <ul>
    +1242  * <li>{String} type - DirectoryString type of DisplayText.
    +1243  * "ia5" for IA5String, "vis" for VisibleString,
    +1244  * "bmp" for BMPString and "utf8" for UTF8String.
    +1245  * Default is "utf8". (OPTIONAL)</li>
    +1246  * </ul>
    +1247  * @example
    +1248  * new DisplayText({type: "bmp", str: "Sample Org"})
    +1249  * new DisplayText({type: "ia5", str: "Sample Org"})
    +1250  * new DisplayText({str: "Sample Org"})
    +1251  */
    +1252 KJUR.asn1.x509.DisplayText = function(params) {
    +1253     KJUR.asn1.x509.DisplayText.superclass.constructor.call(this, params);
     1254 
    -1255     if (params !== undefined) {
    -1256 	if (params.type === "ia5") {
    -1257 	    this.hT = "16";
    -1258 	} else if (params.type === "vis") {
    -1259 	    this.hT = "1a";
    -1260 	} else if (params.type === "bmp") {
    -1261 	    this.hT = "1e";
    -1262 	}
    -1263     }
    -1264 };
    -1265 YAHOO.lang.extend(KJUR.asn1.x509.DisplayText, KJUR.asn1.DERAbstractString);
    -1266 // ===== END CertificatePolicies related classes =====
    -1267 
    -1268 // =====================================================================
    -1269 /**
    -1270  * KeyUsage ASN.1 structure class
    -1271  * @name KJUR.asn1.x509.ExtKeyUsage
    -1272  * @class ExtKeyUsage ASN.1 structure class
    -1273  * @param {Array} params associative array of parameters
    -1274  * @extends KJUR.asn1.x509.Extension
    -1275  * @description
    -1276  * @example
    -1277  * e1 = new KJUR.asn1.x509.ExtKeyUsage({
    -1278  *   critical: true,
    -1279  *   array: [
    -1280  *     {oid: '2.5.29.37.0'},  // anyExtendedKeyUsage
    -1281  *     {name: 'clientAuth'},
    -1282  *     "1.2.3.4",
    -1283  *     "serverAuth"
    -1284  *   ]
    -1285  * });
    -1286  * // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
    -1287  * // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
    -1288  * // KeyPurposeId ::= OBJECT IDENTIFIER
    -1289  */
    -1290 KJUR.asn1.x509.ExtKeyUsage = function(params) {
    -1291     KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this, params);
    -1292     var _KJUR = KJUR,
    -1293 	_KJUR_asn1 = _KJUR.asn1;
    -1294 
    -1295     this.setPurposeArray = function(purposeArray) {
    -1296         this.asn1ExtnValue = new _KJUR_asn1.DERSequence();
    -1297         for (var i = 0; i < purposeArray.length; i++) {
    -1298             var o = new _KJUR_asn1.DERObjectIdentifier(purposeArray[i]);
    -1299             this.asn1ExtnValue.appendASN1Object(o);
    -1300         }
    -1301     };
    -1302 
    -1303     this.getExtnValueHex = function() {
    -1304         return this.asn1ExtnValue.getEncodedHex();
    -1305     };
    -1306 
    -1307     this.oid = "2.5.29.37";
    -1308     if (params !== undefined) {
    -1309         if (params.array !== undefined) {
    -1310             this.setPurposeArray(params.array);
    -1311         }
    -1312     }
    -1313 };
    -1314 YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage, KJUR.asn1.x509.Extension);
    -1315 
    -1316 /**
    -1317  * AuthorityKeyIdentifier ASN.1 structure class
    -1318  * @name KJUR.asn1.x509.AuthorityKeyIdentifier
    -1319  * @class AuthorityKeyIdentifier ASN.1 structure class
    -1320  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    -1321  * @extends KJUR.asn1.x509.Extension
    -1322  * @since asn1x509 1.0.8
    -1323  * @description
    -1324  * This class represents ASN.1 structure for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.1">AuthorityKeyIdentifier in RFC 5280</a>.
    -1325  * Constructor of this class may have following parameters.: 
    -1326  * <ul>
    -1327  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of issuing authority public key or issuer certificate is specified, key identifier will be automatically calculated by the method specified in RFC 5280. When a hexadecimal string is specifed, kid will be set explicitly by it.</li>
    -1328  * <li>isscert - When PEM string of authority certificate is specified, both authorityCertIssuer and authorityCertSerialNumber will be set by the certificate.</li>
    -1329  * <li>issuer - {@link KJUR.asn1.x509.X500Name} parameter to specify issuer name explicitly.</li>
    -1330  * <li>sn - hexadecimal string to specify serial number explicitly.</li>
    -1331  * <li>critical - boolean to specify criticality of this extension
    -1332  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    -1333  * </ul>
    -1334  * 
    -1335  * <pre>
    -1336  * d-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
    -1337  * AuthorityKeyIdentifier ::= SEQUENCE {
    -1338  *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
    -1339  *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
    -1340  *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
    -1341  * KeyIdentifier ::= OCTET STRING
    -1342  * </pre>
    -1343  *
    -1344  * @example
    -1345  * // 1. kid by key object
    -1346  * keyobj = KEYUTIL.getKey("-----BEGIN PUBLIC KEY...");
    -1347  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: keyobj});
    -1348  * // 2. kid by PEM string of authority certificate or public key
    -1349  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "-----BEGIN..."});
    -1350  * // 3. specify kid explicitly
    -1351  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "8ab1d3..."});
    -1352  * });
    -1353  * // 4. issuer and serial number by auhtority PEM certificate
    -1354  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({isscert: "-----BEGIN..."});
    -1355  * // 5. issuer and serial number explicitly
    -1356  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    -1357  *   issuer: {ldapstr: "O=test,C=US"},
    -1358  *   sn: {hex: "1ac7..."}});
    -1359  * // 6. combination
    -1360  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    -1361  *   kid: "-----BEGIN CERTIFICATE...",
    -1362  *   isscert: "-----BEGIN CERTIFICATE..."});
    -1363  */
    -1364 KJUR.asn1.x509.AuthorityKeyIdentifier = function(params) {
    -1365     KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this, params);
    -1366     var _KJUR = KJUR,
    -1367 	_KJUR_asn1 = _KJUR.asn1,
    -1368 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -1369 	_GeneralNames = _KJUR_asn1.x509.GeneralNames,
    -1370 	_isKey = _KJUR.crypto.Util.isKey;
    -1371 
    -1372     this.asn1KID = null;
    -1373     this.asn1CertIssuer = null; // X500Name hTLV
    -1374     this.asn1CertSN = null;
    -1375 
    -1376     this.getExtnValueHex = function() {
    -1377         var a = new Array();
    -1378         if (this.asn1KID)
    -1379             a.push(new _DERTaggedObject({'explicit': false,
    -1380                                          'tag': '80',
    -1381                                          'obj': this.asn1KID}));
    -1382 
    -1383         if (this.asn1CertIssuer)
    -1384             a.push(new _DERTaggedObject({'explicit': false,
    -1385                                          'tag': 'a1',
    -1386                                          'obj': new _GeneralNames([{dn: this.asn1CertIssuer}])}));
    -1387 
    -1388         if (this.asn1CertSN)
    -1389             a.push(new _DERTaggedObject({'explicit': false,
    -1390                                          'tag': '82',
    -1391                                          'obj': this.asn1CertSN}));
    -1392 
    -1393         var asn1Seq = new _KJUR_asn1.DERSequence({'array': a});
    -1394         this.asn1ExtnValue = asn1Seq;
    -1395         return this.asn1ExtnValue.getEncodedHex();
    -1396     };
    -1397 
    -1398     /**
    -1399      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    -1400      * @name setKIDByParam
    -1401      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -1402      * @function
    -1403      * @param {Array} param parameter to set key identifier
    -1404      * @since asn1x509 1.0.8
    -1405      * @description
    -1406      * This method will set keyIdentifier by param.
    -1407      * Its key identifier value can be set by following type of param argument:
    -1408      * <ul>
    -1409      * <li>{str: "123"} - by raw string</li>
    -1410      * <li>{hex: "01af..."} - by hexadecimal value</li>
    -1411      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    -1412      * key identifier value will be calculated by the method described in
    -1413      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1414      * </li>
    -1415      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    -1416      * certificate and
    -1417      * key identifier value will be calculated by the method described in
    -1418      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1419      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    -1420      * to PKCS#8 ASN.1 structure then calculate 
    -1421      * a key identifier value will be calculated by the method described in
    -1422      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1423      * </ul>
    -1424      *
    -1425      * NOTE1: Automatic key identifier calculation is supported
    -1426      * since jsrsasign 8.0.16.
    -1427      *
    -1428      * @see KEYUTIL.getKeyID
    -1429      * 
    -1430      * @example
    -1431      * o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    -1432      * // set by hexadecimal string
    -1433      * o.setKIDByParam({hex: '1ad9...'});
    -1434      * // set by SubjectPublicKeyInfo of PEM certificate string
    -1435      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    -1436      * // set by PKCS#8 PEM public key string
    -1437      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    -1438      * // set by public key object
    -1439      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -1440      * o.setKIDByParam(pubkey);
    -1441      */
    -1442     this.setKIDByParam = function(param) {
    -1443 	if (param.str !== undefined ||
    -1444 	    param.hex !== undefined) {
    -1445 	    this.asn1KID = new KJUR.asn1.DEROctetString(param);
    -1446 	} else if ((typeof param === "object" &&
    -1447 		    KJUR.crypto.Util.isKey(param)) ||
    -1448 		   (typeof param === "string" &&
    -1449 		    param.indexOf("BEGIN ") != -1)) {
    -1450 
    -1451 	    var keyobj = param;
    -1452 	    if (typeof param === "string") {
    -1453 		keyobj = KEYUTIL.getKey(param);
    -1454 	    }
    -1455 
    -1456 	    var kid = KEYUTIL.getKeyID(keyobj);
    -1457 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    -1458 	}
    -1459     };
    -1460 
    -1461     /**
    -1462      * set authorityCertIssuer value by X500Name parameter
    -1463      * @name setCertIssuerByParam
    -1464      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -1465      * @function
    -1466      * @param {Array} param parameter to set issuer name
    -1467      * @since asn1x509 1.0.8
    -1468      * @description
    -1469      * This method will set authorityCertIssuer name by param.
    -1470      * Issuer name can be set by following type of param argument:
    -1471      * <ul>
    -1472      * <li>str/ldapstr/hex/certsubject/certissuer - 
    -1473      * set issuer by {@link KJUR.asn1.x509.X500Name}
    -1474      * object with specified parameters.</li>
    -1475      * <li>PEM CERTIFICATE STRING - extract its subject name from 
    -1476      * specified issuer PEM certificate and set.
    -1477      * </ul>
    -1478      * NOTE1: Automatic authorityCertIssuer setting by certificate
    -1479      * is supported since jsrsasign 8.0.16.
    -1480      *
    -1481      * @see KJUR.asn1.x509.X500Name
    -1482      * @see KJUR.asn1.x509.GeneralNames
    -1483      * @see X509.getSubjectHex
    -1484      *
    -1485      * @example
    -1486      * var o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    -1487      * // 1. set it by string
    -1488      * o.setCertIssuerByParam({str: '/C=US/O=Test'});
    -1489      * // 2. set it by issuer PEM certificate
    -1490      * o.setCertIssuerByParam("-----BEGIN CERTIFICATE...");
    -1491      *
    -1492      */
    -1493     this.setCertIssuerByParam = function(param) {
    -1494 	if (param.str !== undefined ||
    -1495 	    param.ldapstr !== undefined ||
    -1496 	    param.hex !== undefined ||
    -1497 	    param.certsubject !== undefined ||
    -1498 	    param.certissuer !== undefined) {
    -1499             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name(param);
    -1500 	} else if (typeof param === "string" &&
    -1501 		   param.indexOf("BEGIN ") != -1 &&
    -1502 		   param.indexOf("CERTIFICATE") != -1) {
    -1503             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name({certissuer: param});
    -1504 	}
    -1505     };
    -1506 
    -1507     /**
    -1508      * set authorityCertSerialNumber value
    -1509      * @name setCertSerialNumberByParam
    -1510      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -1511      * @function
    -1512      * @param {Object} param parameter to set serial number
    -1513      * @since asn1x509 1.0.8
    -1514      * @description
    -1515      * This method will set authorityCertSerialNumber by param.
    -1516      * Serial number can be set by following type of param argument:
    -1517      *
    -1518      * <ul>
    -1519      * <li>{int: 123} - by integer value</li>
    -1520      * <li>{hex: "01af"} - by hexadecimal integer value</li>
    -1521      * <li>{bigint: new BigInteger(...)} - by hexadecimal integer value</li>
    -1522      * <li>PEM CERTIFICATE STRING - extract serial number from issuer certificate and
    -1523      * set serial number.
    -1524      * 
    -1525      * NOTE1: Automatic authorityCertSerialNumber setting by certificate
    -1526      * is supported since jsrsasign 8.0.16.
    -1527      *
    -1528      * @see X509.getSerialNumberHex
    -1529      */
    -1530     this.setCertSNByParam = function(param) {
    -1531 	if (param.str !== undefined ||
    -1532 	    param.bigint !== undefined ||
    -1533 	    param.hex !== undefined) {
    -1534             this.asn1CertSN = new KJUR.asn1.DERInteger(param);
    -1535 	} else if (typeof param === "string" &&
    -1536 		   param.indexOf("BEGIN ") != -1 &&
    -1537 		   param.indexOf("CERTIFICATE")) {
    -1538 
    -1539             var x = new X509();
    -1540             x.readCertPEM(param);
    -1541 	    var sn = x.getSerialNumberHex();
    -1542 	    this.asn1CertSN = new KJUR.asn1.DERInteger({hex: sn});
    -1543 	}
    -1544     };
    -1545 
    -1546     this.oid = "2.5.29.35";
    -1547     if (params !== undefined) {
    -1548         if (params.kid !== undefined) {
    -1549             this.setKIDByParam(params.kid);
    -1550         }
    -1551         if (params.issuer !== undefined) {
    -1552             this.setCertIssuerByParam(params.issuer);
    -1553         }
    -1554         if (params.sn !== undefined) {
    -1555             this.setCertSNByParam(params.sn);
    -1556         }
    -1557 
    -1558 	if (params.issuersn !== undefined &&
    -1559 	    typeof params.issuersn === "string" &&
    -1560 	    params.issuersn.indexOf("BEGIN ") != -1 &&
    -1561 	    params.issuersn.indexOf("CERTIFICATE")) {
    -1562 	    this.setCertSNByParam(params.issuersn);
    -1563 	    this.setCertIssuerByParam(params.issuersn);
    -1564 	}
    -1565     }
    -1566 };
    -1567 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier, KJUR.asn1.x509.Extension);
    -1568 
    -1569 /**
    -1570  * SubjectKeyIdentifier extension ASN.1 structure class
    -1571  * @name KJUR.asn1.x509.SubjectKeyIdentifier
    -1572  * @class SubjectKeyIdentifier ASN.1 structure class
    -1573  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    -1574  * @extends KJUR.asn1.x509.Extension
    -1575  * @since asn1x509 1.1.7 jsrsasign 8.0.14
    -1576  * @description
    -1577  * This class represents ASN.1 structure for 
    -1578  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">
    -1579  * SubjectKeyIdentifier in RFC 5280</a>.
    -1580  * Constructor of this class may have following parameters:
    -1581  * <ul>
    -1582  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of subject public key or certificate is specified, key identifier will be automatically calculated by the method specified in RFC 5280. When a hexadecimal string is specifed, kid will be set explicitly by it.</li>
    -1583  * <li>critical - boolean to specify criticality of this extension
    -1584  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    -1585  * </ul>
    -1586  * <pre>
    -1587  * d-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 }
    -1588  * SubjectKeyIdentifier ::= KeyIdentifier
    -1589  * KeyIdentifier ::= OCTET STRING
    -1590  * </pre>
    -1591  *
    -1592  * @example
    -1593  * // set by hexadecimal string
    -1594  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: {hex: '89ab'}});
    -1595  * // set by PEM public key or certificate string
    -1596  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: "-----BEGIN CERTIFICATE..."});
    -1597  * // set by public key object
    -1598  * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -1599  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: pubkey});
    -1600  */
    -1601 KJUR.asn1.x509.SubjectKeyIdentifier = function(params) {
    -1602     KJUR.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this, params);
    -1603     var _KJUR = KJUR,
    -1604 	_KJUR_asn1 = _KJUR.asn1,
    -1605 	_DEROctetString = _KJUR_asn1.DEROctetString;
    -1606 
    -1607     this.asn1KID = null;
    +1255     this.hT = "0c"; // DEFAULT "utf8"
    +1256 
    +1257     if (params !== undefined) {
    +1258 	if (params.type === "ia5") {
    +1259 	    this.hT = "16";
    +1260 	} else if (params.type === "vis") {
    +1261 	    this.hT = "1a";
    +1262 	} else if (params.type === "bmp") {
    +1263 	    this.hT = "1e";
    +1264 	}
    +1265     }
    +1266 };
    +1267 YAHOO.lang.extend(KJUR.asn1.x509.DisplayText, KJUR.asn1.DERAbstractString);
    +1268 // ===== END CertificatePolicies related classes =====
    +1269 
    +1270 // =====================================================================
    +1271 /**
    +1272  * KeyUsage ASN.1 structure class
    +1273  * @name KJUR.asn1.x509.ExtKeyUsage
    +1274  * @class ExtKeyUsage ASN.1 structure class
    +1275  * @param {Array} params associative array of parameters
    +1276  * @extends KJUR.asn1.x509.Extension
    +1277  * @description
    +1278  * @example
    +1279  * e1 = new KJUR.asn1.x509.ExtKeyUsage({
    +1280  *   critical: true,
    +1281  *   array: [
    +1282  *     {oid: '2.5.29.37.0'},  // anyExtendedKeyUsage
    +1283  *     {name: 'clientAuth'},
    +1284  *     "1.2.3.4",
    +1285  *     "serverAuth"
    +1286  *   ]
    +1287  * });
    +1288  * // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
    +1289  * // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
    +1290  * // KeyPurposeId ::= OBJECT IDENTIFIER
    +1291  */
    +1292 KJUR.asn1.x509.ExtKeyUsage = function(params) {
    +1293     KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this, params);
    +1294     var _KJUR = KJUR,
    +1295 	_KJUR_asn1 = _KJUR.asn1;
    +1296 
    +1297     this.setPurposeArray = function(purposeArray) {
    +1298         this.asn1ExtnValue = new _KJUR_asn1.DERSequence();
    +1299         for (var i = 0; i < purposeArray.length; i++) {
    +1300             var o = new _KJUR_asn1.DERObjectIdentifier(purposeArray[i]);
    +1301             this.asn1ExtnValue.appendASN1Object(o);
    +1302         }
    +1303     };
    +1304 
    +1305     this.getExtnValueHex = function() {
    +1306         return this.asn1ExtnValue.getEncodedHex();
    +1307     };
    +1308 
    +1309     this.oid = "2.5.29.37";
    +1310     if (params !== undefined) {
    +1311         if (params.array !== undefined) {
    +1312             this.setPurposeArray(params.array);
    +1313         }
    +1314     }
    +1315 };
    +1316 YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage, KJUR.asn1.x509.Extension);
    +1317 
    +1318 /**
    +1319  * AuthorityKeyIdentifier ASN.1 structure class
    +1320  * @name KJUR.asn1.x509.AuthorityKeyIdentifier
    +1321  * @class AuthorityKeyIdentifier ASN.1 structure class
    +1322  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    +1323  * @extends KJUR.asn1.x509.Extension
    +1324  * @since asn1x509 1.0.8
    +1325  * @description
    +1326  * This class represents ASN.1 structure for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.1">AuthorityKeyIdentifier in RFC 5280</a>.
    +1327  * Constructor of this class may have following parameters.: 
    +1328  * <ul>
    +1329  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of issuing authority public key or issuer certificate is specified, key identifier will be automatically calculated by the method specified in RFC 5280. When a hexadecimal string is specifed, kid will be set explicitly by it.</li>
    +1330  * <li>isscert - When PEM string of authority certificate is specified, both authorityCertIssuer and authorityCertSerialNumber will be set by the certificate.</li>
    +1331  * <li>issuer - {@link KJUR.asn1.x509.X500Name} parameter to specify issuer name explicitly.</li>
    +1332  * <li>sn - hexadecimal string to specify serial number explicitly.</li>
    +1333  * <li>critical - boolean to specify criticality of this extension
    +1334  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    +1335  * </ul>
    +1336  * 
    +1337  * <pre>
    +1338  * d-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
    +1339  * AuthorityKeyIdentifier ::= SEQUENCE {
    +1340  *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
    +1341  *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
    +1342  *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
    +1343  * KeyIdentifier ::= OCTET STRING
    +1344  * </pre>
    +1345  *
    +1346  * @example
    +1347  * // 1. kid by key object
    +1348  * keyobj = KEYUTIL.getKey("-----BEGIN PUBLIC KEY...");
    +1349  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: keyobj});
    +1350  * // 2. kid by PEM string of authority certificate or public key
    +1351  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "-----BEGIN..."});
    +1352  * // 3. specify kid explicitly
    +1353  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "8ab1d3..."});
    +1354  * });
    +1355  * // 4. issuer and serial number by auhtority PEM certificate
    +1356  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({isscert: "-----BEGIN..."});
    +1357  * // 5. issuer and serial number explicitly
    +1358  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    +1359  *   issuer: {ldapstr: "O=test,C=US"},
    +1360  *   sn: {hex: "1ac7..."}});
    +1361  * // 6. combination
    +1362  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    +1363  *   kid: "-----BEGIN CERTIFICATE...",
    +1364  *   isscert: "-----BEGIN CERTIFICATE..."});
    +1365  */
    +1366 KJUR.asn1.x509.AuthorityKeyIdentifier = function(params) {
    +1367     KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this, params);
    +1368     var _KJUR = KJUR,
    +1369 	_KJUR_asn1 = _KJUR.asn1,
    +1370 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +1371 	_GeneralNames = _KJUR_asn1.x509.GeneralNames,
    +1372 	_isKey = _KJUR.crypto.Util.isKey;
    +1373 
    +1374     this.asn1KID = null;
    +1375     this.asn1CertIssuer = null; // X500Name hTLV
    +1376     this.asn1CertSN = null;
    +1377 
    +1378     this.getExtnValueHex = function() {
    +1379         var a = new Array();
    +1380         if (this.asn1KID)
    +1381             a.push(new _DERTaggedObject({'explicit': false,
    +1382                                          'tag': '80',
    +1383                                          'obj': this.asn1KID}));
    +1384 
    +1385         if (this.asn1CertIssuer)
    +1386             a.push(new _DERTaggedObject({'explicit': false,
    +1387                                          'tag': 'a1',
    +1388                                          'obj': new _GeneralNames([{dn: this.asn1CertIssuer}])}));
    +1389 
    +1390         if (this.asn1CertSN)
    +1391             a.push(new _DERTaggedObject({'explicit': false,
    +1392                                          'tag': '82',
    +1393                                          'obj': this.asn1CertSN}));
    +1394 
    +1395         var asn1Seq = new _KJUR_asn1.DERSequence({'array': a});
    +1396         this.asn1ExtnValue = asn1Seq;
    +1397         return this.asn1ExtnValue.getEncodedHex();
    +1398     };
    +1399 
    +1400     /**
    +1401      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    +1402      * @name setKIDByParam
    +1403      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1404      * @function
    +1405      * @param {Array} param parameter to set key identifier
    +1406      * @since asn1x509 1.0.8
    +1407      * @description
    +1408      * This method will set keyIdentifier by param.
    +1409      * Its key identifier value can be set by following type of param argument:
    +1410      * <ul>
    +1411      * <li>{str: "123"} - by raw string</li>
    +1412      * <li>{hex: "01af..."} - by hexadecimal value</li>
    +1413      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    +1414      * key identifier value will be calculated by the method described in
    +1415      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1416      * </li>
    +1417      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    +1418      * certificate and
    +1419      * key identifier value will be calculated by the method described in
    +1420      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1421      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    +1422      * to PKCS#8 ASN.1 structure then calculate 
    +1423      * a key identifier value will be calculated by the method described in
    +1424      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1425      * </ul>
    +1426      *
    +1427      * NOTE1: Automatic key identifier calculation is supported
    +1428      * since jsrsasign 8.0.16.
    +1429      *
    +1430      * @see KEYUTIL.getKeyID
    +1431      * 
    +1432      * @example
    +1433      * o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    +1434      * // set by hexadecimal string
    +1435      * o.setKIDByParam({hex: '1ad9...'});
    +1436      * // set by SubjectPublicKeyInfo of PEM certificate string
    +1437      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    +1438      * // set by PKCS#8 PEM public key string
    +1439      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    +1440      * // set by public key object
    +1441      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1442      * o.setKIDByParam(pubkey);
    +1443      */
    +1444     this.setKIDByParam = function(param) {
    +1445 	if (param.str !== undefined ||
    +1446 	    param.hex !== undefined) {
    +1447 	    this.asn1KID = new KJUR.asn1.DEROctetString(param);
    +1448 	} else if ((typeof param === "object" &&
    +1449 		    KJUR.crypto.Util.isKey(param)) ||
    +1450 		   (typeof param === "string" &&
    +1451 		    param.indexOf("BEGIN ") != -1)) {
    +1452 
    +1453 	    var keyobj = param;
    +1454 	    if (typeof param === "string") {
    +1455 		keyobj = KEYUTIL.getKey(param);
    +1456 	    }
    +1457 
    +1458 	    var kid = KEYUTIL.getKeyID(keyobj);
    +1459 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    +1460 	}
    +1461     };
    +1462 
    +1463     /**
    +1464      * set authorityCertIssuer value by X500Name parameter
    +1465      * @name setCertIssuerByParam
    +1466      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1467      * @function
    +1468      * @param {Array} param parameter to set issuer name
    +1469      * @since asn1x509 1.0.8
    +1470      * @description
    +1471      * This method will set authorityCertIssuer name by param.
    +1472      * Issuer name can be set by following type of param argument:
    +1473      * <ul>
    +1474      * <li>str/ldapstr/hex/certsubject/certissuer - 
    +1475      * set issuer by {@link KJUR.asn1.x509.X500Name}
    +1476      * object with specified parameters.</li>
    +1477      * <li>PEM CERTIFICATE STRING - extract its subject name from 
    +1478      * specified issuer PEM certificate and set.
    +1479      * </ul>
    +1480      * NOTE1: Automatic authorityCertIssuer setting by certificate
    +1481      * is supported since jsrsasign 8.0.16.
    +1482      *
    +1483      * @see KJUR.asn1.x509.X500Name
    +1484      * @see KJUR.asn1.x509.GeneralNames
    +1485      * @see X509.getSubjectHex
    +1486      *
    +1487      * @example
    +1488      * var o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    +1489      * // 1. set it by string
    +1490      * o.setCertIssuerByParam({str: '/C=US/O=Test'});
    +1491      * // 2. set it by issuer PEM certificate
    +1492      * o.setCertIssuerByParam("-----BEGIN CERTIFICATE...");
    +1493      *
    +1494      */
    +1495     this.setCertIssuerByParam = function(param) {
    +1496 	if (param.str !== undefined ||
    +1497 	    param.ldapstr !== undefined ||
    +1498 	    param.hex !== undefined ||
    +1499 	    param.certsubject !== undefined ||
    +1500 	    param.certissuer !== undefined) {
    +1501             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name(param);
    +1502 	} else if (typeof param === "string" &&
    +1503 		   param.indexOf("BEGIN ") != -1 &&
    +1504 		   param.indexOf("CERTIFICATE") != -1) {
    +1505             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name({certissuer: param});
    +1506 	}
    +1507     };
    +1508 
    +1509     /**
    +1510      * set authorityCertSerialNumber value
    +1511      * @name setCertSerialNumberByParam
    +1512      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1513      * @function
    +1514      * @param {Object} param parameter to set serial number
    +1515      * @since asn1x509 1.0.8
    +1516      * @description
    +1517      * This method will set authorityCertSerialNumber by param.
    +1518      * Serial number can be set by following type of param argument:
    +1519      *
    +1520      * <ul>
    +1521      * <li>{int: 123} - by integer value</li>
    +1522      * <li>{hex: "01af"} - by hexadecimal integer value</li>
    +1523      * <li>{bigint: new BigInteger(...)} - by hexadecimal integer value</li>
    +1524      * <li>PEM CERTIFICATE STRING - extract serial number from issuer certificate and
    +1525      * set serial number.
    +1526      * 
    +1527      * NOTE1: Automatic authorityCertSerialNumber setting by certificate
    +1528      * is supported since jsrsasign 8.0.16.
    +1529      *
    +1530      * @see X509.getSerialNumberHex
    +1531      */
    +1532     this.setCertSNByParam = function(param) {
    +1533 	if (param.str !== undefined ||
    +1534 	    param.bigint !== undefined ||
    +1535 	    param.hex !== undefined) {
    +1536             this.asn1CertSN = new KJUR.asn1.DERInteger(param);
    +1537 	} else if (typeof param === "string" &&
    +1538 		   param.indexOf("BEGIN ") != -1 &&
    +1539 		   param.indexOf("CERTIFICATE")) {
    +1540 
    +1541             var x = new X509();
    +1542             x.readCertPEM(param);
    +1543 	    var sn = x.getSerialNumberHex();
    +1544 	    this.asn1CertSN = new KJUR.asn1.DERInteger({hex: sn});
    +1545 	}
    +1546     };
    +1547 
    +1548     this.oid = "2.5.29.35";
    +1549     if (params !== undefined) {
    +1550         if (params.kid !== undefined) {
    +1551             this.setKIDByParam(params.kid);
    +1552         }
    +1553         if (params.issuer !== undefined) {
    +1554             this.setCertIssuerByParam(params.issuer);
    +1555         }
    +1556         if (params.sn !== undefined) {
    +1557             this.setCertSNByParam(params.sn);
    +1558         }
    +1559 
    +1560 	if (params.issuersn !== undefined &&
    +1561 	    typeof params.issuersn === "string" &&
    +1562 	    params.issuersn.indexOf("BEGIN ") != -1 &&
    +1563 	    params.issuersn.indexOf("CERTIFICATE")) {
    +1564 	    this.setCertSNByParam(params.issuersn);
    +1565 	    this.setCertIssuerByParam(params.issuersn);
    +1566 	}
    +1567     }
    +1568 };
    +1569 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier, KJUR.asn1.x509.Extension);
    +1570 
    +1571 /**
    +1572  * SubjectKeyIdentifier extension ASN.1 structure class
    +1573  * @name KJUR.asn1.x509.SubjectKeyIdentifier
    +1574  * @class SubjectKeyIdentifier ASN.1 structure class
    +1575  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    +1576  * @extends KJUR.asn1.x509.Extension
    +1577  * @since asn1x509 1.1.7 jsrsasign 8.0.14
    +1578  * @description
    +1579  * This class represents ASN.1 structure for 
    +1580  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">
    +1581  * SubjectKeyIdentifier in RFC 5280</a>.
    +1582  * Constructor of this class may have following parameters:
    +1583  * <ul>
    +1584  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of subject public key or certificate is specified, key identifier will be automatically calculated by the method specified in RFC 5280. When a hexadecimal string is specifed, kid will be set explicitly by it.</li>
    +1585  * <li>critical - boolean to specify criticality of this extension
    +1586  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    +1587  * </ul>
    +1588  * <pre>
    +1589  * d-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 }
    +1590  * SubjectKeyIdentifier ::= KeyIdentifier
    +1591  * KeyIdentifier ::= OCTET STRING
    +1592  * </pre>
    +1593  *
    +1594  * @example
    +1595  * // set by hexadecimal string
    +1596  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: {hex: '89ab'}});
    +1597  * // set by PEM public key or certificate string
    +1598  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: "-----BEGIN CERTIFICATE..."});
    +1599  * // set by public key object
    +1600  * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1601  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: pubkey});
    +1602  */
    +1603 KJUR.asn1.x509.SubjectKeyIdentifier = function(params) {
    +1604     KJUR.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this, params);
    +1605     var _KJUR = KJUR,
    +1606 	_KJUR_asn1 = _KJUR.asn1,
    +1607 	_DEROctetString = _KJUR_asn1.DEROctetString;
     1608 
    -1609     this.getExtnValueHex = function() {
    -1610         this.asn1ExtnValue = this.asn1KID;
    -1611         return this.asn1ExtnValue.getEncodedHex();
    -1612     };
    -1613 
    -1614     /**
    -1615      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    -1616      * @name setKIDByParam
    -1617      * @memberOf KJUR.asn1.x509.SubjectKeyIdentifier#
    -1618      * @function
    -1619      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
    -1620      * @since asn1x509 1.1.7 jsrsasign 8.0.14
    -1621      * @description
    -1622      * <ul>
    -1623      * <li>{str: "123"} - by raw string</li>
    -1624      * <li>{hex: "01af..."} - by hexadecimal value</li>
    -1625      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    -1626      * key identifier value will be calculated by the method described in
    -1627      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1628      * </li>
    -1629      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    -1630      * certificate and
    -1631      * key identifier value will be calculated by the method described in
    -1632      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1633      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    -1634      * to PKCS#8 ASN.1 structure then calculate 
    -1635      * a key identifier value will be calculated by the method described in
    -1636      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1637      * </ul>
    -1638      *
    -1639      * NOTE1: Automatic key identifier calculation is supported
    -1640      * since jsrsasign 8.0.16.
    -1641      *
    -1642      * @see KEYUTIL.getKeyID
    +1609     this.asn1KID = null;
    +1610 
    +1611     this.getExtnValueHex = function() {
    +1612         this.asn1ExtnValue = this.asn1KID;
    +1613         return this.asn1ExtnValue.getEncodedHex();
    +1614     };
    +1615 
    +1616     /**
    +1617      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    +1618      * @name setKIDByParam
    +1619      * @memberOf KJUR.asn1.x509.SubjectKeyIdentifier#
    +1620      * @function
    +1621      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
    +1622      * @since asn1x509 1.1.7 jsrsasign 8.0.14
    +1623      * @description
    +1624      * <ul>
    +1625      * <li>{str: "123"} - by raw string</li>
    +1626      * <li>{hex: "01af..."} - by hexadecimal value</li>
    +1627      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    +1628      * key identifier value will be calculated by the method described in
    +1629      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1630      * </li>
    +1631      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    +1632      * certificate and
    +1633      * key identifier value will be calculated by the method described in
    +1634      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1635      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    +1636      * to PKCS#8 ASN.1 structure then calculate 
    +1637      * a key identifier value will be calculated by the method described in
    +1638      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1639      * </ul>
    +1640      *
    +1641      * NOTE1: Automatic key identifier calculation is supported
    +1642      * since jsrsasign 8.0.16.
     1643      *
    -1644      * @example
    -1645      * o = new KJUR.asn1.x509.SubjectKeyIdentifier();
    -1646      * // set by hexadecimal string
    -1647      * o.setKIDByParam({hex: '1ad9...'});
    -1648      * // set by SubjectPublicKeyInfo of PEM certificate string
    -1649      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    -1650      * // set by PKCS#8 PEM public key string
    -1651      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    -1652      * // set by public key object
    -1653      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -1654      * o.setKIDByParam(pubkey);
    -1655      */
    -1656     this.setKIDByParam = function(param) {
    -1657 	if (param.str !== undefined ||
    -1658 	    param.hex !== undefined) {
    -1659 	    this.asn1KID = new _DEROctetString(param);
    -1660 	} else if ((typeof param === "object" &&
    -1661 		    KJUR.crypto.Util.isKey(param)) ||
    -1662 		   (typeof param === "string" &&
    -1663 		    param.indexOf("BEGIN") != -1)) {
    -1664 
    -1665 	    var keyobj = param;
    -1666 	    if (typeof param === "string") {
    -1667 		keyobj = KEYUTIL.getKey(param);
    -1668 	    }
    -1669 
    -1670 	    var kid = KEYUTIL.getKeyID(keyobj);
    -1671 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    -1672 	}
    -1673     };
    -1674 
    -1675     this.oid = "2.5.29.14";
    -1676     if (params !== undefined) {
    -1677 	if (params.kid !== undefined) {
    -1678 	    this.setKIDByParam(params.kid);
    -1679 	}
    -1680     }
    -1681 };
    -1682 YAHOO.lang.extend(KJUR.asn1.x509.SubjectKeyIdentifier, KJUR.asn1.x509.Extension);
    -1683 
    -1684 /**
    -1685  * AuthorityInfoAccess ASN.1 structure class
    -1686  * @name KJUR.asn1.x509.AuthorityInfoAccess
    -1687  * @class AuthorityInfoAccess ASN.1 structure class
    -1688  * @param {Array} params JSON object of AuthorityInfoAccess parameters
    -1689  * @extends KJUR.asn1.x509.Extension
    -1690  * @since asn1x509 1.0.8
    -1691  * @see {@link X509#getExtAuthorityInfoAccess}
    -1692  * @description
    -1693  * This class represents 
    -1694  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.2.1">
    -1695  * AuthorityInfoAccess extension defined in RFC 5280 4.2.2.1</a>.
    -1696  * <pre>
    -1697  * id-pe OBJECT IDENTIFIER  ::=  { id-pkix 1 }
    -1698  * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
    -1699  * AuthorityInfoAccessSyntax  ::=
    -1700  *         SEQUENCE SIZE (1..MAX) OF AccessDescription
    -1701  * AccessDescription  ::=  SEQUENCE {
    -1702  *         accessMethod          OBJECT IDENTIFIER,
    -1703  *         accessLocation        GeneralName  }
    -1704  * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
    -1705  * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
    -1706  * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
    -1707  * </pre>
    -1708  * NOTE: Acceptable parameters have been changed since
    -1709  * from jsrsasign 9.0.0 asn1x509 2.0.0.
    -1710  * Parameter generated by {@link X509#getAuthorityInfoAccess}
    -1711  * can be accepted as a argument of this constructor.
    -1712  * @example
    -1713  * e1 = new KJUR.asn1.x509.AuthorityInfoAccess({
    -1714  *   array: [
    -1715  *     {ocsp: 'http://ocsp.example.org'},
    -1716  *     {caissuer: 'https://repository.example.org/aaa.crt'}
    -1717  *   ]
    -1718  * });
    -1719  */
    -1720 KJUR.asn1.x509.AuthorityInfoAccess = function(params) {
    -1721     KJUR.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this, params);
    -1722 
    -1723     this.setAccessDescriptionArray = function(aParam) {
    -1724         var aASN1 = new Array(),
    -1725 	    _KJUR = KJUR,
    -1726 	    _KJUR_asn1 = _KJUR.asn1,
    -1727 	    _DERSequence = _KJUR_asn1.DERSequence,
    -1728 	    _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -1729 	    _GeneralName = _KJUR_asn1.x509.GeneralName;
    -1730 
    -1731         for (var i = 0; i < aParam.length; i++) {
    -1732 	    var adseq;
    -1733 	    var adparam = aParam[i];
    -1734 
    -1735 	    if (adparam.ocsp !== undefined) {
    -1736 		adseq = new _DERSequence({array: [
    -1737 		    new _DERObjectIdentifier({oid: "1.3.6.1.5.5.7.48.1"}),
    -1738 		    new _GeneralName({uri: adparam.ocsp})
    -1739 		]});
    -1740 	    } else if (adparam.caissuer !== undefined) {
    -1741 		adseq = new _DERSequence({array: [
    -1742 		    new _DERObjectIdentifier({oid: "1.3.6.1.5.5.7.48.2"}),
    -1743 		    new _GeneralName({uri: adparam.caissuer})
    -1744 		]});
    -1745 	    } else {
    -1746 		throw new Error("unknown AccessMethod parameter: " +
    -1747 				JSON.stringify(adparam));
    -1748 	    }
    -1749 	    aASN1.push(adseq);
    -1750         }
    -1751         this.asn1ExtnValue = new _DERSequence({'array':aASN1});
    -1752     };
    -1753 
    -1754     this.getExtnValueHex = function() {
    -1755         return this.asn1ExtnValue.getEncodedHex();
    -1756     };
    -1757 
    -1758     this.oid = "1.3.6.1.5.5.7.1.1";
    -1759     if (params !== undefined) {
    -1760         if (params.array !== undefined) {
    -1761             this.setAccessDescriptionArray(params.array);
    -1762         }
    -1763     }
    -1764 };
    -1765 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityInfoAccess, KJUR.asn1.x509.Extension);
    -1766 
    -1767 /**
    -1768  * SubjectAltName ASN.1 structure class<br/>
    -1769  * @name KJUR.asn1.x509.SubjectAltName
    -1770  * @class SubjectAltName ASN.1 structure class
    -1771  * @param {Array} params associative array of parameters
    -1772  * @extends KJUR.asn1.x509.Extension
    -1773  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    -1774  * @see KJUR.asn1.x509.GeneralNames
    -1775  * @see KJUR.asn1.x509.GeneralName
    -1776  * @description
    -1777  * This class provides X.509v3 SubjectAltName extension.
    -1778  * <pre>
    -1779  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 }
    -1780  * SubjectAltName ::= GeneralNames
    -1781  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -1782  * GeneralName ::= CHOICE {
    -1783  *   otherName                  [0] OtherName,
    -1784  *   rfc822Name                 [1] IA5String,
    -1785  *   dNSName                    [2] IA5String,
    -1786  *   x400Address                [3] ORAddress,
    -1787  *   directoryName              [4] Name,
    -1788  *   ediPartyName               [5] EDIPartyName,
    -1789  *   uniformResourceIdentifier  [6] IA5String,
    -1790  *   iPAddress                  [7] OCTET STRING,
    -1791  *   registeredID               [8] OBJECT IDENTIFIER }
    -1792  * </pre>
    -1793  * @example
    -1794  * e1 = new KJUR.asn1.x509.SubjectAltName({
    -1795  *   critical: true,
    -1796  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    -1797  * });
    -1798  */
    -1799 KJUR.asn1.x509.SubjectAltName = function(params) {
    -1800     KJUR.asn1.x509.SubjectAltName.superclass.constructor.call(this, params)
    -1801 
    -1802     this.setNameArray = function(paramsArray) {
    -1803 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    -1804     };
    -1805 
    -1806     this.getExtnValueHex = function() {
    -1807         return this.asn1ExtnValue.getEncodedHex();
    -1808     };
    -1809 
    -1810     this.oid = "2.5.29.17";
    -1811     if (params !== undefined) {
    -1812         if (params.array !== undefined) {
    -1813             this.setNameArray(params.array);
    -1814         }
    -1815     }
    -1816 };
    -1817 YAHOO.lang.extend(KJUR.asn1.x509.SubjectAltName, KJUR.asn1.x509.Extension);
    -1818 
    -1819 /**
    -1820  * IssuerAltName ASN.1 structure class<br/>
    -1821  * @name KJUR.asn1.x509.IssuerAltName
    -1822  * @class IssuerAltName ASN.1 structure class
    -1823  * @param {Array} params associative array of parameters
    -1824  * @extends KJUR.asn1.x509.Extension
    -1825  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    -1826  * @see KJUR.asn1.x509.GeneralNames
    -1827  * @see KJUR.asn1.x509.GeneralName
    -1828  * @description
    -1829  * This class provides X.509v3 IssuerAltName extension.
    -1830  * <pre>
    -1831  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 18 }
    -1832  * IssuerAltName ::= GeneralNames
    -1833  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -1834  * GeneralName ::= CHOICE {
    -1835  *   otherName                  [0] OtherName,
    -1836  *   rfc822Name                 [1] IA5String,
    -1837  *   dNSName                    [2] IA5String,
    -1838  *   x400Address                [3] ORAddress,
    -1839  *   directoryName              [4] Name,
    -1840  *   ediPartyName               [5] EDIPartyName,
    -1841  *   uniformResourceIdentifier  [6] IA5String,
    -1842  *   iPAddress                  [7] OCTET STRING,
    -1843  *   registeredID               [8] OBJECT IDENTIFIER }
    -1844  * </pre>
    -1845  * @example
    -1846  * e1 = new KJUR.asn1.x509.IssuerAltName({
    -1847  *   critical: true,
    -1848  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    -1849  * });
    -1850  */
    -1851 KJUR.asn1.x509.IssuerAltName = function(params) {
    -1852     KJUR.asn1.x509.IssuerAltName.superclass.constructor.call(this, params)
    -1853 
    -1854     this.setNameArray = function(paramsArray) {
    -1855 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    -1856     };
    -1857 
    -1858     this.getExtnValueHex = function() {
    -1859         return this.asn1ExtnValue.getEncodedHex();
    -1860     };
    -1861 
    -1862     this.oid = "2.5.29.18";
    -1863     if (params !== undefined) {
    -1864         if (params.array !== undefined) {
    -1865             this.setNameArray(params.array);
    -1866         }
    -1867     }
    -1868 };
    -1869 YAHOO.lang.extend(KJUR.asn1.x509.IssuerAltName, KJUR.asn1.x509.Extension);
    -1870 
    -1871 /**
    -1872  * priavte extension ASN.1 structure class<br/>
    -1873  * @name KJUR.asn1.x509.PrivateExtension
    -1874  * @class private extension ASN.1 structure class
    -1875  * @param {Array} params JSON object of private extension
    -1876  * @extends KJUR.asn1.x509.Extension
    -1877  * @since jsrsasign 9.1.1 asn1x509 
    -1878  * @see KJUR.asn1.ASN1Util.newObject
    -1879  *
    -1880  * @description
    -1881  * This class is to represent private extension or 
    -1882  * unsupported extension. 
    -1883  * <pre>
    -1884  * Extension  ::=  SEQUENCE  {
    -1885  *      extnID      OBJECT IDENTIFIER,
    -1886  *      critical    BOOLEAN DEFAULT FALSE,
    -1887  *      extnValue   OCTET STRING }
    -1888  * </pre>
    -1889  * Following properties can be set for JSON parameter:
    -1890  * <ul>
    -1891  * <li>{String}extname - string of OID or predefined extension name</li>
    -1892  * <li>{Boolean}critical - critical flag</li>
    -1893  * <li>{Object}extn - hexadecimal string or 
    -1894  * of {@link KJUR.asn1.ASN1Util.newObject} 
    -1895  * JSON parameter for extnValue field</li>
    -1896  * </li>
    -1897  * </ul>
    -1898  *
    -1899  * @example
    -1900  * // extn by hexadecimal
    -1901  * new KJUR.asn1.x509.PrivateExtension({
    -1902  *   extname: "1.2.3.4",
    -1903  *   critical: true,
    -1904  *   extn: "13026161" // means PrintableString "aa"
    -1905  * });
    -1906  *
    -1907  * // extn by JSON parameter
    -1908  * new KJUR.asn1.x509.PrivateExtension({
    -1909  *   extname: "1.2.3.5",
    -1910  *   extn: {seq: [{prnstr:"abc"},{utf8str:"def"}]}
    -1911  * });
    -1912  */
    -1913 KJUR.asn1.x509.PrivateExtension = function(params) {
    -1914     KJUR.asn1.x509.PrivateExtension.superclass.constructor.call(this, params)
    -1915 
    -1916     var _KJUR = KJUR,
    -1917 	_isHex = _KJUR.lang.String.isHex,
    -1918 	_KJUR_asn1 = _KJUR.asn1,
    -1919 	_name2oid = _KJUR_asn1.x509.OID.name2oid,
    -1920 	_newObject = _KJUR_asn1.ASN1Util.newObject;
    -1921 
    -1922     this.params = null;
    +1644      * @see KEYUTIL.getKeyID
    +1645      *
    +1646      * @example
    +1647      * o = new KJUR.asn1.x509.SubjectKeyIdentifier();
    +1648      * // set by hexadecimal string
    +1649      * o.setKIDByParam({hex: '1ad9...'});
    +1650      * // set by SubjectPublicKeyInfo of PEM certificate string
    +1651      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    +1652      * // set by PKCS#8 PEM public key string
    +1653      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    +1654      * // set by public key object
    +1655      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1656      * o.setKIDByParam(pubkey);
    +1657      */
    +1658     this.setKIDByParam = function(param) {
    +1659 	if (param.str !== undefined ||
    +1660 	    param.hex !== undefined) {
    +1661 	    this.asn1KID = new _DEROctetString(param);
    +1662 	} else if ((typeof param === "object" &&
    +1663 		    KJUR.crypto.Util.isKey(param)) ||
    +1664 		   (typeof param === "string" &&
    +1665 		    param.indexOf("BEGIN") != -1)) {
    +1666 
    +1667 	    var keyobj = param;
    +1668 	    if (typeof param === "string") {
    +1669 		keyobj = KEYUTIL.getKey(param);
    +1670 	    }
    +1671 
    +1672 	    var kid = KEYUTIL.getKeyID(keyobj);
    +1673 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    +1674 	}
    +1675     };
    +1676 
    +1677     this.oid = "2.5.29.14";
    +1678     if (params !== undefined) {
    +1679 	if (params.kid !== undefined) {
    +1680 	    this.setKIDByParam(params.kid);
    +1681 	}
    +1682     }
    +1683 };
    +1684 YAHOO.lang.extend(KJUR.asn1.x509.SubjectKeyIdentifier, KJUR.asn1.x509.Extension);
    +1685 
    +1686 /**
    +1687  * AuthorityInfoAccess ASN.1 structure class
    +1688  * @name KJUR.asn1.x509.AuthorityInfoAccess
    +1689  * @class AuthorityInfoAccess ASN.1 structure class
    +1690  * @param {Array} params JSON object of AuthorityInfoAccess parameters
    +1691  * @extends KJUR.asn1.x509.Extension
    +1692  * @since asn1x509 1.0.8
    +1693  * @see {@link X509#getExtAuthorityInfoAccess}
    +1694  * @description
    +1695  * This class represents 
    +1696  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.2.1">
    +1697  * AuthorityInfoAccess extension defined in RFC 5280 4.2.2.1</a>.
    +1698  * <pre>
    +1699  * id-pe OBJECT IDENTIFIER  ::=  { id-pkix 1 }
    +1700  * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
    +1701  * AuthorityInfoAccessSyntax  ::=
    +1702  *         SEQUENCE SIZE (1..MAX) OF AccessDescription
    +1703  * AccessDescription  ::=  SEQUENCE {
    +1704  *         accessMethod          OBJECT IDENTIFIER,
    +1705  *         accessLocation        GeneralName  }
    +1706  * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
    +1707  * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
    +1708  * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
    +1709  * </pre>
    +1710  * NOTE: Acceptable parameters have been changed since
    +1711  * from jsrsasign 9.0.0 asn1x509 2.0.0.
    +1712  * Parameter generated by {@link X509#getAuthorityInfoAccess}
    +1713  * can be accepted as a argument of this constructor.
    +1714  * @example
    +1715  * e1 = new KJUR.asn1.x509.AuthorityInfoAccess({
    +1716  *   array: [
    +1717  *     {ocsp: 'http://ocsp.example.org'},
    +1718  *     {caissuer: 'https://repository.example.org/aaa.crt'}
    +1719  *   ]
    +1720  * });
    +1721  */
    +1722 KJUR.asn1.x509.AuthorityInfoAccess = function(params) {
    +1723     KJUR.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this, params);
    +1724 
    +1725     this.setAccessDescriptionArray = function(aParam) {
    +1726         var aASN1 = new Array(),
    +1727 	    _KJUR = KJUR,
    +1728 	    _KJUR_asn1 = _KJUR.asn1,
    +1729 	    _DERSequence = _KJUR_asn1.DERSequence,
    +1730 	    _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +1731 	    _GeneralName = _KJUR_asn1.x509.GeneralName;
    +1732 
    +1733         for (var i = 0; i < aParam.length; i++) {
    +1734 	    var adseq;
    +1735 	    var adparam = aParam[i];
    +1736 
    +1737 	    if (adparam.ocsp !== undefined) {
    +1738 		adseq = new _DERSequence({array: [
    +1739 		    new _DERObjectIdentifier({oid: "1.3.6.1.5.5.7.48.1"}),
    +1740 		    new _GeneralName({uri: adparam.ocsp})
    +1741 		]});
    +1742 	    } else if (adparam.caissuer !== undefined) {
    +1743 		adseq = new _DERSequence({array: [
    +1744 		    new _DERObjectIdentifier({oid: "1.3.6.1.5.5.7.48.2"}),
    +1745 		    new _GeneralName({uri: adparam.caissuer})
    +1746 		]});
    +1747 	    } else {
    +1748 		throw new Error("unknown AccessMethod parameter: " +
    +1749 				JSON.stringify(adparam));
    +1750 	    }
    +1751 	    aASN1.push(adseq);
    +1752         }
    +1753         this.asn1ExtnValue = new _DERSequence({'array':aASN1});
    +1754     };
    +1755 
    +1756     this.getExtnValueHex = function() {
    +1757         return this.asn1ExtnValue.getEncodedHex();
    +1758     };
    +1759 
    +1760     this.oid = "1.3.6.1.5.5.7.1.1";
    +1761     if (params !== undefined) {
    +1762         if (params.array !== undefined) {
    +1763             this.setAccessDescriptionArray(params.array);
    +1764         }
    +1765     }
    +1766 };
    +1767 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityInfoAccess, KJUR.asn1.x509.Extension);
    +1768 
    +1769 /**
    +1770  * SubjectAltName ASN.1 structure class<br/>
    +1771  * @name KJUR.asn1.x509.SubjectAltName
    +1772  * @class SubjectAltName ASN.1 structure class
    +1773  * @param {Array} params associative array of parameters
    +1774  * @extends KJUR.asn1.x509.Extension
    +1775  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    +1776  * @see KJUR.asn1.x509.GeneralNames
    +1777  * @see KJUR.asn1.x509.GeneralName
    +1778  * @description
    +1779  * This class provides X.509v3 SubjectAltName extension.
    +1780  * <pre>
    +1781  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 }
    +1782  * SubjectAltName ::= GeneralNames
    +1783  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +1784  * GeneralName ::= CHOICE {
    +1785  *   otherName                  [0] OtherName,
    +1786  *   rfc822Name                 [1] IA5String,
    +1787  *   dNSName                    [2] IA5String,
    +1788  *   x400Address                [3] ORAddress,
    +1789  *   directoryName              [4] Name,
    +1790  *   ediPartyName               [5] EDIPartyName,
    +1791  *   uniformResourceIdentifier  [6] IA5String,
    +1792  *   iPAddress                  [7] OCTET STRING,
    +1793  *   registeredID               [8] OBJECT IDENTIFIER }
    +1794  * </pre>
    +1795  * @example
    +1796  * e1 = new KJUR.asn1.x509.SubjectAltName({
    +1797  *   critical: true,
    +1798  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    +1799  * });
    +1800  */
    +1801 KJUR.asn1.x509.SubjectAltName = function(params) {
    +1802     KJUR.asn1.x509.SubjectAltName.superclass.constructor.call(this, params)
    +1803 
    +1804     this.setNameArray = function(paramsArray) {
    +1805 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    +1806     };
    +1807 
    +1808     this.getExtnValueHex = function() {
    +1809         return this.asn1ExtnValue.getEncodedHex();
    +1810     };
    +1811 
    +1812     this.oid = "2.5.29.17";
    +1813     if (params !== undefined) {
    +1814         if (params.array !== undefined) {
    +1815             this.setNameArray(params.array);
    +1816         }
    +1817     }
    +1818 };
    +1819 YAHOO.lang.extend(KJUR.asn1.x509.SubjectAltName, KJUR.asn1.x509.Extension);
    +1820 
    +1821 /**
    +1822  * IssuerAltName ASN.1 structure class<br/>
    +1823  * @name KJUR.asn1.x509.IssuerAltName
    +1824  * @class IssuerAltName ASN.1 structure class
    +1825  * @param {Array} params associative array of parameters
    +1826  * @extends KJUR.asn1.x509.Extension
    +1827  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    +1828  * @see KJUR.asn1.x509.GeneralNames
    +1829  * @see KJUR.asn1.x509.GeneralName
    +1830  * @description
    +1831  * This class provides X.509v3 IssuerAltName extension.
    +1832  * <pre>
    +1833  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 18 }
    +1834  * IssuerAltName ::= GeneralNames
    +1835  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +1836  * GeneralName ::= CHOICE {
    +1837  *   otherName                  [0] OtherName,
    +1838  *   rfc822Name                 [1] IA5String,
    +1839  *   dNSName                    [2] IA5String,
    +1840  *   x400Address                [3] ORAddress,
    +1841  *   directoryName              [4] Name,
    +1842  *   ediPartyName               [5] EDIPartyName,
    +1843  *   uniformResourceIdentifier  [6] IA5String,
    +1844  *   iPAddress                  [7] OCTET STRING,
    +1845  *   registeredID               [8] OBJECT IDENTIFIER }
    +1846  * </pre>
    +1847  * @example
    +1848  * e1 = new KJUR.asn1.x509.IssuerAltName({
    +1849  *   critical: true,
    +1850  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    +1851  * });
    +1852  */
    +1853 KJUR.asn1.x509.IssuerAltName = function(params) {
    +1854     KJUR.asn1.x509.IssuerAltName.superclass.constructor.call(this, params)
    +1855 
    +1856     this.setNameArray = function(paramsArray) {
    +1857 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    +1858     };
    +1859 
    +1860     this.getExtnValueHex = function() {
    +1861         return this.asn1ExtnValue.getEncodedHex();
    +1862     };
    +1863 
    +1864     this.oid = "2.5.29.18";
    +1865     if (params !== undefined) {
    +1866         if (params.array !== undefined) {
    +1867             this.setNameArray(params.array);
    +1868         }
    +1869     }
    +1870 };
    +1871 YAHOO.lang.extend(KJUR.asn1.x509.IssuerAltName, KJUR.asn1.x509.Extension);
    +1872 
    +1873 /**
    +1874  * priavte extension ASN.1 structure class<br/>
    +1875  * @name KJUR.asn1.x509.PrivateExtension
    +1876  * @class private extension ASN.1 structure class
    +1877  * @param {Array} params JSON object of private extension
    +1878  * @extends KJUR.asn1.x509.Extension
    +1879  * @since jsrsasign 9.1.1 asn1x509 
    +1880  * @see KJUR.asn1.ASN1Util.newObject
    +1881  *
    +1882  * @description
    +1883  * This class is to represent private extension or 
    +1884  * unsupported extension. 
    +1885  * <pre>
    +1886  * Extension  ::=  SEQUENCE  {
    +1887  *      extnID      OBJECT IDENTIFIER,
    +1888  *      critical    BOOLEAN DEFAULT FALSE,
    +1889  *      extnValue   OCTET STRING }
    +1890  * </pre>
    +1891  * Following properties can be set for JSON parameter:
    +1892  * <ul>
    +1893  * <li>{String}extname - string of OID or predefined extension name</li>
    +1894  * <li>{Boolean}critical - critical flag</li>
    +1895  * <li>{Object}extn - hexadecimal string or 
    +1896  * of {@link KJUR.asn1.ASN1Util.newObject} 
    +1897  * JSON parameter for extnValue field</li>
    +1898  * </li>
    +1899  * </ul>
    +1900  *
    +1901  * @example
    +1902  * // extn by hexadecimal
    +1903  * new KJUR.asn1.x509.PrivateExtension({
    +1904  *   extname: "1.2.3.4",
    +1905  *   critical: true,
    +1906  *   extn: "13026161" // means PrintableString "aa"
    +1907  * });
    +1908  *
    +1909  * // extn by JSON parameter
    +1910  * new KJUR.asn1.x509.PrivateExtension({
    +1911  *   extname: "1.2.3.5",
    +1912  *   extn: {seq: [{prnstr:"abc"},{utf8str:"def"}]}
    +1913  * });
    +1914  */
    +1915 KJUR.asn1.x509.PrivateExtension = function(params) {
    +1916     KJUR.asn1.x509.PrivateExtension.superclass.constructor.call(this, params)
    +1917 
    +1918     var _KJUR = KJUR,
    +1919 	_isHex = _KJUR.lang.String.isHex,
    +1920 	_KJUR_asn1 = _KJUR.asn1,
    +1921 	_name2oid = _KJUR_asn1.x509.OID.name2oid,
    +1922 	_newObject = _KJUR_asn1.ASN1Util.newObject;
     1923 
    -1924     this.setByParam = function(params) {
    -1925 	this.oid = _name2oid(params.extname);
    -1926 	this.params = params;
    -1927     };
    -1928 
    -1929     this.getExtnValueHex = function() {
    -1930 	if (this.params.extname == undefined ||
    -1931 	    this.params.extn == undefined) {
    -1932 	    throw new Error("extname or extnhex not specified");
    -1933 	}
    -1934 
    -1935 	var extn = this.params.extn;
    -1936 	if (typeof extn == "string" && _isHex(extn)) {
    -1937 	    return extn;
    -1938 	} else if (typeof extn == "object") {
    -1939 	    try {
    -1940 		return _newObject(extn).getEncodedHex();
    -1941 	    } catch(ex) {}
    -1942 	}
    -1943 	throw new Error("unsupported extn value");
    -1944     };
    -1945 
    -1946     if (params != undefined) {
    -1947 	this.setByParam(params);
    -1948     }
    -1949 };
    -1950 YAHOO.lang.extend(KJUR.asn1.x509.PrivateExtension, KJUR.asn1.x509.Extension);
    -1951 
    -1952 // === END   X.509v3 Extensions Related =======================================
    +1924     this.params = null;
    +1925 
    +1926     this.setByParam = function(params) {
    +1927 	this.oid = _name2oid(params.extname);
    +1928 	this.params = params;
    +1929     };
    +1930 
    +1931     this.getExtnValueHex = function() {
    +1932 	if (this.params.extname == undefined ||
    +1933 	    this.params.extn == undefined) {
    +1934 	    throw new Error("extname or extnhex not specified");
    +1935 	}
    +1936 
    +1937 	var extn = this.params.extn;
    +1938 	if (typeof extn == "string" && _isHex(extn)) {
    +1939 	    return extn;
    +1940 	} else if (typeof extn == "object") {
    +1941 	    try {
    +1942 		return _newObject(extn).getEncodedHex();
    +1943 	    } catch(ex) {}
    +1944 	}
    +1945 	throw new Error("unsupported extn value");
    +1946     };
    +1947 
    +1948     if (params != undefined) {
    +1949 	this.setByParam(params);
    +1950     }
    +1951 };
    +1952 YAHOO.lang.extend(KJUR.asn1.x509.PrivateExtension, KJUR.asn1.x509.Extension);
     1953 
    -1954 // === BEGIN CRL Related ===================================================
    -1955 /**
    -1956  * X.509 CRL class to sign and generate hex encoded CRL<br/>
    -1957  * @name KJUR.asn1.x509.CRL
    -1958  * @class X.509 CRL class to sign and generate hex encoded certificate
    -1959  * @property {Array} params JSON object of parameters
    -1960  * @param {Array} params JSON object of CRL parameters
    -1961  * @extends KJUR.asn1.ASN1Object
    -1962  * @since 1.0.3
    -1963  * @see KJUR.asn1.x509.TBSCertList
    -1964  * 
    -1965  * @description
    -1966  * This class represents CertificateList ASN.1 structur of X.509 CRL
    -1967  * defined in <a href="https://tools.ietf.org/html/rfc5280#section-5.1">
    -1968  * RFC 5280 5.1</a>
    -1969  * <pre>
    -1970  * CertificateList  ::=  SEQUENCE  {
    -1971  *     tbsCertList          TBSCertList,
    -1972  *     signatureAlgorithm   AlgorithmIdentifier,
    -1973  *     signatureValue       BIT STRING  }
    -1974  * </pre>
    -1975  * NOTE: CRL class is updated without backward 
    -1976  * compatibility from jsrsasign 9.1.0 asn1x509 2.1.0.
    -1977  * Most of methods are removed and parameters can be set
    -1978  * by JSON object.
    -1979  * <br/>
    -1980  * Constructor of this class can accept all
    -1981  * parameters of {@link KJUR.asn1.x509.TBSCertList}.
    -1982  * It also accept following parameters additionally:
    -1983  * <ul>
    -1984  * <li>{TBSCertList}tbsobj (OPTION) - 
    -1985  * specifies {@link KJUR.asn1.x509.TBSCertList} 
    -1986  * object to be signed if needed. 
    -1987  * When this isn't specified, 
    -1988  * this will be set from other parametes of TBSCertList.</li>
    -1989  * <li>{Object}cakey (OPTION) - specifies CRL signing private key.
    -1990  * Parameter "cakey" or "sighex" shall be specified. Following
    -1991  * values can be specified:
    -1992  *   <ul>
    -1993  *   <li>PKCS#1/5 or PKCS#8 PEM string of private key</li>
    -1994  *   <li>RSAKey/DSA/ECDSA key object. {@link KEYUTIL.getKey} is useful
    -1995  *   to generate a key object.</li>
    -1996  *   </ul>
    -1997  * </li>
    -1998  * <li>{String}sighex (OPTION) - hexadecimal string of signature value
    -1999  * (i.e. ASN.1 value(V) of signatureValue BIT STRING without
    -2000  * unused bits)</li>
    -2001  * </ul>
    -2002  *
    -2003  * @example
    -2004  * var crl = new KJUR.asn1x509.CRL({
    -2005  *  sigalg: "SHA256withRSA",
    -2006  *  issuer: {str:'/C=JP/O=Test1'},
    -2007  *  thisupdate: "200821235959Z",
    -2008  *  nextupdate: "200828235959Z", // OPTION
    -2009  *  revcert: [{sn: {hex: "12ab"}, date: "200401235959Z"}],
    -2010  *  ext: [
    -2011  *   {extname: "cRLNumber", num: {'int': 8}},
    -2012  *   {extname: "authorityKeyIdentifier", "kid": {hex: "12ab"}}
    -2013  *  ],
    -2014  *  cakey: prvkey
    -2015  * });
    -2016  * crl.getEncodedHex() → "30..."
    -2017  * crl.getPEM() → "-----BEGIN X509 CRL..."
    -2018  */
    -2019 KJUR.asn1.x509.CRL = function(params) {
    -2020     KJUR.asn1.x509.CRL.superclass.constructor.call(this);
    -2021     var _KJUR = KJUR,
    -2022 	_KJUR_asn1 = _KJUR.asn1,
    -2023 	_DERSequence = _KJUR_asn1.DERSequence,
    -2024 	_DERBitString = _KJUR_asn1.DERBitString,
    -2025 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -2026 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    -2027 	_TBSCertList = _KJUR_asn1_x509.TBSCertList;
    -2028 
    -2029     this.params = undefined;
    +1954 // === END   X.509v3 Extensions Related =======================================
    +1955 
    +1956 // === BEGIN CRL Related ===================================================
    +1957 /**
    +1958  * X.509 CRL class to sign and generate hex encoded CRL<br/>
    +1959  * @name KJUR.asn1.x509.CRL
    +1960  * @class X.509 CRL class to sign and generate hex encoded certificate
    +1961  * @property {Array} params JSON object of parameters
    +1962  * @param {Array} params JSON object of CRL parameters
    +1963  * @extends KJUR.asn1.ASN1Object
    +1964  * @since 1.0.3
    +1965  * @see KJUR.asn1.x509.TBSCertList
    +1966  * 
    +1967  * @description
    +1968  * This class represents CertificateList ASN.1 structur of X.509 CRL
    +1969  * defined in <a href="https://tools.ietf.org/html/rfc5280#section-5.1">
    +1970  * RFC 5280 5.1</a>
    +1971  * <pre>
    +1972  * CertificateList  ::=  SEQUENCE  {
    +1973  *     tbsCertList          TBSCertList,
    +1974  *     signatureAlgorithm   AlgorithmIdentifier,
    +1975  *     signatureValue       BIT STRING  }
    +1976  * </pre>
    +1977  * NOTE: CRL class is updated without backward 
    +1978  * compatibility from jsrsasign 9.1.0 asn1x509 2.1.0.
    +1979  * Most of methods are removed and parameters can be set
    +1980  * by JSON object.
    +1981  * <br/>
    +1982  * Constructor of this class can accept all
    +1983  * parameters of {@link KJUR.asn1.x509.TBSCertList}.
    +1984  * It also accept following parameters additionally:
    +1985  * <ul>
    +1986  * <li>{TBSCertList}tbsobj (OPTION) - 
    +1987  * specifies {@link KJUR.asn1.x509.TBSCertList} 
    +1988  * object to be signed if needed. 
    +1989  * When this isn't specified, 
    +1990  * this will be set from other parametes of TBSCertList.</li>
    +1991  * <li>{Object}cakey (OPTION) - specifies CRL signing private key.
    +1992  * Parameter "cakey" or "sighex" shall be specified. Following
    +1993  * values can be specified:
    +1994  *   <ul>
    +1995  *   <li>PKCS#1/5 or PKCS#8 PEM string of private key</li>
    +1996  *   <li>RSAKey/DSA/ECDSA key object. {@link KEYUTIL.getKey} is useful
    +1997  *   to generate a key object.</li>
    +1998  *   </ul>
    +1999  * </li>
    +2000  * <li>{String}sighex (OPTION) - hexadecimal string of signature value
    +2001  * (i.e. ASN.1 value(V) of signatureValue BIT STRING without
    +2002  * unused bits)</li>
    +2003  * </ul>
    +2004  *
    +2005  * @example
    +2006  * var crl = new KJUR.asn1x509.CRL({
    +2007  *  sigalg: "SHA256withRSA",
    +2008  *  issuer: {str:'/C=JP/O=Test1'},
    +2009  *  thisupdate: "200821235959Z",
    +2010  *  nextupdate: "200828235959Z", // OPTION
    +2011  *  revcert: [{sn: {hex: "12ab"}, date: "200401235959Z"}],
    +2012  *  ext: [
    +2013  *   {extname: "cRLNumber", num: {'int': 8}},
    +2014  *   {extname: "authorityKeyIdentifier", "kid": {hex: "12ab"}}
    +2015  *  ],
    +2016  *  cakey: prvkey
    +2017  * });
    +2018  * crl.getEncodedHex() → "30..."
    +2019  * crl.getPEM() → "-----BEGIN X509 CRL..."
    +2020  */
    +2021 KJUR.asn1.x509.CRL = function(params) {
    +2022     KJUR.asn1.x509.CRL.superclass.constructor.call(this);
    +2023     var _KJUR = KJUR,
    +2024 	_KJUR_asn1 = _KJUR.asn1,
    +2025 	_DERSequence = _KJUR_asn1.DERSequence,
    +2026 	_DERBitString = _KJUR_asn1.DERBitString,
    +2027 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +2028 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    +2029 	_TBSCertList = _KJUR_asn1_x509.TBSCertList;
     2030 
    -2031     this.setByParam = function(params) {
    -2032 	this.params = params;
    -2033     };
    -2034 
    -2035     /**
    -2036      * sign CRL<br/>
    -2037      * @name sign
    -2038      * @memberOf KJUR.asn1.x509.CRL#
    -2039      * @function
    -2040      * @description
    -2041      * This method signs TBSCertList with a specified 
    -2042      * private key and algorithm by 
    -2043      * this.params.cakey and this.params.sigalg parameter.
    -2044      * @example
    -2045      * crl = new KJUR.asn1.x509.CRL({..., cakey:prvkey});
    -2046      * crl.sign()
    -2047      */
    -2048     this.sign = function() {
    -2049 	var hTBSCL = (new _TBSCertList(this.params)).getEncodedHex();
    -2050 	var sig = new KJUR.crypto.Signature({alg: this.params.sigalg});
    -2051 	sig.init(this.params.cakey);
    -2052 	sig.updateHex(hTBSCL);
    -2053 	var sighex = sig.sign();
    -2054 	this.params.sighex = sighex;
    -2055     };
    -2056 
    -2057     /**
    -2058      * get PEM formatted CRL string after signed<br/>
    -2059      * @name getPEM
    -2060      * @memberOf KJUR.asn1.x509.CRL#
    -2061      * @function
    -2062      * @return PEM formatted string of CRL
    -2063      * @since jsrsasign 9.1.0 asn1hex 2.1.0
    -2064      * @description
    -2065      * This method returns a string of PEM formatted 
    -2066      * CRL.
    -2067      * @example
    -2068      * crl = new KJUR.asn1.x509.CRL({...});
    -2069      * crl.getPEM() →
    -2070      * "-----BEGIN X509 CRL-----\r\n..."
    -2071      */
    -2072     this.getPEM = function() {
    -2073 	return hextopem(this.getEncodedHex(), "X509 CRL");
    -2074     };
    -2075 
    -2076     this.getEncodedHex = function() {
    -2077 	var params = this.params;
    -2078 
    -2079 	if (params.tbsobj == undefined) {
    -2080 	    params.tbsobj = new _TBSCertList(params);
    -2081 	}
    -2082 
    -2083 	if (params.sighex == undefined && params.cakey != undefined) {
    -2084 	    this.sign();
    -2085 	}
    -2086 
    -2087 	if (params.sighex == undefined) {
    -2088 	    throw new Error("sighex or cakey parameter not defined");
    -2089 	}
    -2090 	
    -2091 	var a = [];
    -2092 	a.push(params.tbsobj);
    -2093 	a.push(new _AlgorithmIdentifier({name: params.sigalg}));
    -2094 	a.push(new _DERBitString({hex: "00" + params.sighex}));
    -2095 	var seq = new _DERSequence({array: a});
    -2096 	return seq.getEncodedHex();
    -2097     };
    -2098 
    -2099     if (params != undefined) this.params = params;
    -2100 };
    -2101 YAHOO.lang.extend(KJUR.asn1.x509.CRL, KJUR.asn1.ASN1Object);
    -2102 
    -2103 /**
    -2104  * ASN.1 TBSCertList ASN.1 structure class for CRL<br/>
    -2105  * @name KJUR.asn1.x509.TBSCertList
    -2106  * @class TBSCertList ASN.1 structure class for CRL
    -2107  * @property {Array} params JSON object of parameters
    -2108  * @param {Array} params JSON object of TBSCertList parameters
    -2109  * @extends KJUR.asn1.ASN1Object
    -2110  * @since 1.0.3
    -2111  *
    -2112  * @description
    -2113  * This class represents TBSCertList of CRL defined in
    -2114  * <a href="https://tools.ietf.org/html/rfc5280#section-5.1">
    -2115  * RFC 5280 5.1</a>.
    -2116  * <pre>
    -2117  * TBSCertList  ::=  SEQUENCE  {
    -2118  *       version                 Version OPTIONAL,
    -2119  *                                    -- if present, MUST be v2
    -2120  *       signature               AlgorithmIdentifier,
    -2121  *       issuer                  Name,
    -2122  *       thisUpdate              Time,
    -2123  *       nextUpdate              Time OPTIONAL,
    -2124  *       revokedCertificates     SEQUENCE OF SEQUENCE  {
    -2125  *            userCertificate         CertificateSerialNumber,
    -2126  *            revocationDate          Time,
    -2127  *            crlEntryExtensions      Extensions OPTIONAL
    -2128  *                                     -- if present, version MUST be v2
    -2129  *                                 }  OPTIONAL,
    -2130  *       crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    -2131  * }
    -2132  * </pre>
    -2133  * NOTE: TBSCertList class is updated without backward 
    -2134  * compatibility from jsrsasign 9.1.0 asn1x509 2.1.0.
    -2135  * Most of methods are removed and parameters can be set
    -2136  * by JSON object.
    -2137  * <br/>
    -2138  * Constructor of this class may have following parameters:
    -2139  * <ul>
    -2140  * <li>{Integer}version (OPTION) - version number. Omitted by default.</li>
    -2141  * <li>{String}sigalg - signature algorithm name</li>
    -2142  * <li>{Array}issuer - issuer parameter of {@link KJUR.asn1.x509.X500Name}</li>
    -2143  * <li>{String}thisupdate - thisUpdate field value</li>
    -2144  * <li>{String}nextupdate (OPTION) - thisUpdate field value</li>
    -2145  * <li>{Array}revcert (OPTION) - revokedCertificates field value as array
    -2146  *   Its element may have following property:
    -2147  *   <ul>
    -2148  *   <li>{Array}sn - serialNumber of userCertificate field specified
    -2149  *   by {@link KJUR.asn1.DERInteger}</li>
    -2150  *   <li>{String}date - revocationDate field specified by
    -2151  *   a string of {@link KJUR.asn1.x509.Time} parameter</li>
    -2152  *   <li>{Array}ext (OPTION) - array of CRL entry extension parameter</li>
    -2153  *   </ul>
    -2154  * </li>
    -2155  * </ul>
    -2156  * 
    -2157  * @example
    -2158  * var o = new KJUR.asn1.x509.TBSCertList({
    -2159  *  sigalg: "SHA256withRSA",
    -2160  *  issuer: {array: [[{type:'C',value:'JP',ds:'prn'}],
    -2161  *                   [{type:'O',value:'T1',ds:'prn'}]]},
    -2162  *  thisupdate: "200821235959Z",
    -2163  *  nextupdate: "200828235959Z", // OPTION
    -2164  *  revcert: [
    -2165  *   {sn: {hex: "12ab"}, date: "200401235959Z", ext: [{extname: "cRLReason", code:1}]},
    -2166  *   {sn: {hex: "12bc"}, date: "200405235959Z", ext: [{extname: "cRLReason", code:2}]}
    -2167  *  ],
    -2168  *  ext: [
    -2169  *   {extname: "cRLNumber", num: {'int': 8}},
    -2170  *   {extname: "authorityKeyIdentifier", "kid": {hex: "12ab"}}
    -2171  *  ]
    -2172  * });
    -2173  * o.getEncodedHex() → "30..."
    -2174  */
    -2175 KJUR.asn1.x509.TBSCertList = function(params) {
    -2176     KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);
    -2177     var	_KJUR = KJUR,
    -2178 	_KJUR_asn1 = _KJUR.asn1,
    -2179 	_DERInteger = _KJUR_asn1.DERInteger,
    -2180 	_DERSequence = _KJUR_asn1.DERSequence,
    -2181 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -2182 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -2183 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -2184 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    -2185 	_Time = _KJUR_asn1_x509.Time,
    -2186 	_Extensions = _KJUR_asn1_x509.Extensions,
    -2187 	_X500Name = _KJUR_asn1_x509.X500Name;
    -2188     this.params = null;
    -2189 
    -2190     /**
    -2191      * get array of ASN.1 object for extensions<br/>
    -2192      * @name setByParam
    -2193      * @memberOf KJUR.asn1.x509.TBSCertList#
    -2194      * @function
    -2195      * @param {Array} JSON object of TBSCertList parameters
    -2196      * @example
    -2197      * tbsc = new KJUR.asn1.x509.TBSCertificate();
    -2198      * tbsc.setByParam({version:3, serial:{hex:'1234...'},...});
    -2199      */
    -2200     this.setByParam = function(params) {
    -2201 	this.params = params;
    -2202     };
    -2203 
    -2204     /**
    -2205      * get DERSequence for revokedCertificates<br/>
    -2206      * @name getRevCertSequence
    -2207      * @memberOf KJUR.asn1.x509.TBSCertList#
    -2208      * @function
    -2209      * @return {@link KJUR.asn1.DERSequence} of revokedCertificates
    -2210      */
    -2211     this.getRevCertSequence = function() {
    -2212 	var a = [];
    -2213 	var aRevCert = this.params.revcert;
    -2214 	for (var i = 0; i < aRevCert.length; i++) {
    -2215 	    var aEntry = [
    -2216 		new _DERInteger(aRevCert[i].sn),
    -2217 		new _Time(aRevCert[i].date)
    -2218 	    ];
    -2219 	    if (aRevCert[i].ext != undefined) {
    -2220 		aEntry.push(new _Extensions(aRevCert[i].ext));
    -2221 	    }
    -2222 	    a.push(new _DERSequence({array: aEntry}));
    -2223 	}
    -2224 	return new _DERSequence({array: a});
    -2225     };
    -2226 
    -2227     this.getEncodedHex = function() {
    -2228 	var a = [];
    -2229 	var params = this.params;
    -2230 
    -2231 	if (params.version != undefined) {
    -2232 	    var version = params.version - 1; 
    -2233 	    var obj = new _DERInteger({'int': version});
    -2234 	    a.push(obj);
    -2235 	}
    -2236 
    -2237 	a.push(new _AlgorithmIdentifier({name: params.sigalg}));
    -2238 	a.push(new _X500Name(params.issuer));
    -2239 	a.push(new _Time(params.thisupdate));
    -2240 	if (params.nextupdate != undefined) 
    -2241 	    a.push(new _Time(params.nextupdate))
    -2242 	if (params.revcert != undefined) {
    -2243 	    a.push(this.getRevCertSequence());
    -2244 	}
    -2245 	if (params.ext != undefined) {
    -2246 	    var dExt = new _Extensions(params.ext);
    -2247 	    a.push(new _DERTaggedObject({tag:'a0',
    -2248 					 explicit:true,
    -2249 					 obj:dExt}));
    -2250 	}
    -2251 
    -2252 	var seq = new _DERSequence({array: a});
    -2253 	return seq.getEncodedHex();
    -2254     };
    -2255 
    -2256     if (params !== undefined) this.setByParam(params);
    -2257 };
    -2258 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList, KJUR.asn1.ASN1Object);
    -2259 
    -2260 /**
    -2261  * ASN.1 CRLEntry structure class for CRL (DEPRECATED)<br/>
    -2262  * @name KJUR.asn1.x509.CRLEntry
    -2263  * @class ASN.1 CRLEntry structure class for CRL
    -2264  * @param {Array} params JSON object for CRL entry parameter
    -2265  * @extends KJUR.asn1.ASN1Object
    -2266  * @since 1.0.3
    -2267  * @see KJUR.asn1.x509.TBSCertList
    -2268  * @deprecated since jsrsasign 9.1.0 asn1x509 2.1.0
    -2269  * @description
    -2270  * This class is to represent revokedCertificate in TBSCertList.
    -2271  * However this is no more used by TBSCertList since
    -2272  * jsrsasign 9.1.0. So this class have been deprecated in 
    -2273  * jsrsasign 9.1.0.
    -2274  * <pre>
    -2275  * revokedCertificates     SEQUENCE OF SEQUENCE  {
    -2276  *     userCertificate         CertificateSerialNumber,
    -2277  *     revocationDate          Time,
    -2278  *     crlEntryExtensions      Extensions OPTIONAL
    -2279  *                             -- if present, version MUST be v2 }
    -2280  * </pre>
    -2281  * @example
    -2282  * var e = new KJUR.asn1.x509.CRLEntry({'time': {'str': '130514235959Z'}, 'sn': {'int': 234}});
    -2283  */
    -2284 KJUR.asn1.x509.CRLEntry = function(params) {
    -2285     KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);
    -2286     var sn = null,
    -2287 	time = null,
    -2288 	_KJUR = KJUR,
    -2289 	_KJUR_asn1 = _KJUR.asn1;
    -2290 
    -2291     /**
    -2292      * set DERInteger parameter for serial number of revoked certificate
    -2293      * @name setCertSerial
    -2294      * @memberOf KJUR.asn1.x509.CRLEntry
    -2295      * @function
    -2296      * @param {Array} intParam DERInteger parameter for certificate serial number
    -2297      * @description
    -2298      * @example
    -2299      * entry.setCertSerial({'int': 3});
    -2300      */
    -2301     this.setCertSerial = function(intParam) {
    -2302         this.sn = new _KJUR_asn1.DERInteger(intParam);
    -2303     };
    -2304 
    -2305     /**
    -2306      * set Time parameter for revocation date
    -2307      * @name setRevocationDate
    -2308      * @memberOf KJUR.asn1.x509.CRLEntry
    -2309      * @function
    -2310      * @param {Array} timeParam Time parameter for revocation date
    -2311      * @description
    -2312      * @example
    -2313      * entry.setRevocationDate({'str': '130508235959Z'});
    -2314      */
    -2315     this.setRevocationDate = function(timeParam) {
    -2316         this.time = new _KJUR_asn1.x509.Time(timeParam);
    -2317     };
    -2318 
    -2319     this.getEncodedHex = function() {
    -2320         var o = new _KJUR_asn1.DERSequence({"array": [this.sn, this.time]});
    -2321         this.TLV = o.getEncodedHex();
    -2322         return this.TLV;
    -2323     };
    -2324 
    -2325     if (params !== undefined) {
    -2326         if (params.time !== undefined) {
    -2327             this.setRevocationDate(params.time);
    -2328         }
    -2329         if (params.sn !== undefined) {
    -2330             this.setCertSerial(params.sn);
    -2331         }
    -2332     }
    -2333 };
    -2334 YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry, KJUR.asn1.ASN1Object);
    -2335 
    -2336 /**
    -2337  * CRLNumber CRL extension ASN.1 structure class<br/>
    -2338  * @name KJUR.asn1.x509.CRLNumber
    -2339  * @class CRLNumber CRL extension ASN.1 structure class
    -2340  * @extends KJUR.asn1.x509.Extension
    -2341  * @since jsrsasign 9.1.0 asn1x509 2.1.0
    -2342  * @see KJUR.asn1.x509.TBSCertList
    -2343  * @see KJUR.asn1.x509.Extensions
    -2344  * @description
    -2345  * This class represents ASN.1 structure for
    -2346  * CRLNumber CRL extension defined in
    -2347  * <a href="https://tools.ietf.org/html/rfc5280#section-5.2.3">
    -2348  * RFC 5280 5.2.3</a>.
    -2349  * <pre>
    -2350  * id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 }
    -2351  * CRLNumber ::= INTEGER (0..MAX)
    -2352  * </pre>
    -2353  * Constructor of this class may have following parameters:
    -2354  * <ul>
    -2355  * <li>{String}extname - name "cRLNumber". It is ignored in this class but
    -2356  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    -2357  * <li>{Object}num - CRLNumber value to specify
    -2358  * {@link KJUR.asn1.DERInteger} parameter.</li>
    -2359  * <li>{Boolean}critical - critical flag. Generally false and not specified
    -2360  * in this class.(OPTION)</li>
    -2361  * </ul>
    -2362  *
    -2363  * @example
    -2364  * new KJUR.asn1.x509.CRLNumber({extname:'cRLNumber',
    -2365  *                               num:{'int':147}})
    -2366  */
    -2367 KJUR.asn1.x509.CRLNumber = function(params) {
    -2368     KJUR.asn1.x509.CRLNumber.superclass.constructor.call(this, params);
    -2369     this.params = undefined;
    -2370 
    -2371     this.getExtnValueHex = function() {
    -2372         this.asn1ExtnValue = new KJUR.asn1.DERInteger(this.params.num);
    -2373         return this.asn1ExtnValue.getEncodedHex();
    -2374     };
    -2375 
    -2376     this.oid = "2.5.29.20";
    -2377     if (params != undefined) this.params = params;
    -2378 };
    -2379 YAHOO.lang.extend(KJUR.asn1.x509.CRLNumber, KJUR.asn1.x509.Extension);
    -2380 
    -2381 /**
    -2382  * CRLReason CRL entry extension ASN.1 structure class<br/>
    -2383  * @name KJUR.asn1.x509.CRLReason
    -2384  * @class CRLReason CRL entry extension ASN.1 structure class
    -2385  * @extends KJUR.asn1.x509.Extension
    -2386  * @since jsrsasign 9.1.0 asn1x509 2.1.0
    -2387  * @see KJUR.asn1.x509.TBSCertList
    -2388  * @see KJUR.asn1.x509.Extensions
    -2389  * @description
    -2390  * This class represents ASN.1 structure for
    -2391  * CRLReason CRL entry extension defined in
    -2392  * <a href="https://tools.ietf.org/html/rfc5280#section-5.3.1">
    -2393  * RFC 5280 5.3.1</a>
    -2394  * <pre>
    -2395  * id-ce-cRLReasons OBJECT IDENTIFIER ::= { id-ce 21 }
    -2396  * -- reasonCode ::= { CRLReason }
    -2397  * CRLReason ::= ENUMERATED {
    -2398  *      unspecified             (0),
    -2399  *      keyCompromise           (1),
    -2400  *      cACompromise            (2),
    -2401  *      affiliationChanged      (3),
    -2402  *      superseded              (4),
    -2403  *      cessationOfOperation    (5),
    -2404  *      certificateHold         (6),
    -2405  *      removeFromCRL           (8),
    -2406  *      privilegeWithdrawn      (9),
    -2407  *      aACompromise           (10) }
    -2408  * </pre>
    -2409  * Constructor of this class may have following parameters:
    -2410  * <ul>
    -2411  * <li>{String}extname - name "cRLReason". It is ignored in this class but
    -2412  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    -2413  * <li>{Integer}code - reasonCode value</li>
    -2414  * <li>{Boolean}critical - critical flag. Generally false and not specified
    -2415  * in this class.(OPTION)</li>
    -2416  * </ul>
    -2417  *
    -2418  * @example
    -2419  * new KJUR.asn1.x509.CRLReason({extname:'cRLNumber',code:4})
    -2420  */
    -2421 KJUR.asn1.x509.CRLReason = function(params) {
    -2422     KJUR.asn1.x509.CRLReason.superclass.constructor.call(this, params);
    -2423     this.params = undefined;
    -2424 
    -2425     this.getExtnValueHex = function() {
    -2426         this.asn1ExtnValue = new KJUR.asn1.DEREnumerated(this.params.code);
    -2427         return this.asn1ExtnValue.getEncodedHex();
    -2428     };
    -2429 
    -2430     this.oid = "2.5.29.21";
    -2431     if (params != undefined) this.params = params;
    -2432 };
    -2433 YAHOO.lang.extend(KJUR.asn1.x509.CRLReason, KJUR.asn1.x509.Extension);
    -2434 
    -2435 // === END   CRL Related ===================================================
    +2031     this.params = undefined;
    +2032 
    +2033     this.setByParam = function(params) {
    +2034 	this.params = params;
    +2035     };
    +2036 
    +2037     /**
    +2038      * sign CRL<br/>
    +2039      * @name sign
    +2040      * @memberOf KJUR.asn1.x509.CRL#
    +2041      * @function
    +2042      * @description
    +2043      * This method signs TBSCertList with a specified 
    +2044      * private key and algorithm by 
    +2045      * this.params.cakey and this.params.sigalg parameter.
    +2046      * @example
    +2047      * crl = new KJUR.asn1.x509.CRL({..., cakey:prvkey});
    +2048      * crl.sign()
    +2049      */
    +2050     this.sign = function() {
    +2051 	var hTBSCL = (new _TBSCertList(this.params)).getEncodedHex();
    +2052 	var sig = new KJUR.crypto.Signature({alg: this.params.sigalg});
    +2053 	sig.init(this.params.cakey);
    +2054 	sig.updateHex(hTBSCL);
    +2055 	var sighex = sig.sign();
    +2056 	this.params.sighex = sighex;
    +2057     };
    +2058 
    +2059     /**
    +2060      * get PEM formatted CRL string after signed<br/>
    +2061      * @name getPEM
    +2062      * @memberOf KJUR.asn1.x509.CRL#
    +2063      * @function
    +2064      * @return PEM formatted string of CRL
    +2065      * @since jsrsasign 9.1.0 asn1hex 2.1.0
    +2066      * @description
    +2067      * This method returns a string of PEM formatted 
    +2068      * CRL.
    +2069      * @example
    +2070      * crl = new KJUR.asn1.x509.CRL({...});
    +2071      * crl.getPEM() →
    +2072      * "-----BEGIN X509 CRL-----\r\n..."
    +2073      */
    +2074     this.getPEM = function() {
    +2075 	return hextopem(this.getEncodedHex(), "X509 CRL");
    +2076     };
    +2077 
    +2078     this.getEncodedHex = function() {
    +2079 	var params = this.params;
    +2080 
    +2081 	if (params.tbsobj == undefined) {
    +2082 	    params.tbsobj = new _TBSCertList(params);
    +2083 	}
    +2084 
    +2085 	if (params.sighex == undefined && params.cakey != undefined) {
    +2086 	    this.sign();
    +2087 	}
    +2088 
    +2089 	if (params.sighex == undefined) {
    +2090 	    throw new Error("sighex or cakey parameter not defined");
    +2091 	}
    +2092 	
    +2093 	var a = [];
    +2094 	a.push(params.tbsobj);
    +2095 	a.push(new _AlgorithmIdentifier({name: params.sigalg}));
    +2096 	a.push(new _DERBitString({hex: "00" + params.sighex}));
    +2097 	var seq = new _DERSequence({array: a});
    +2098 	return seq.getEncodedHex();
    +2099     };
    +2100 
    +2101     if (params != undefined) this.params = params;
    +2102 };
    +2103 YAHOO.lang.extend(KJUR.asn1.x509.CRL, KJUR.asn1.ASN1Object);
    +2104 
    +2105 /**
    +2106  * ASN.1 TBSCertList ASN.1 structure class for CRL<br/>
    +2107  * @name KJUR.asn1.x509.TBSCertList
    +2108  * @class TBSCertList ASN.1 structure class for CRL
    +2109  * @property {Array} params JSON object of parameters
    +2110  * @param {Array} params JSON object of TBSCertList parameters
    +2111  * @extends KJUR.asn1.ASN1Object
    +2112  * @since 1.0.3
    +2113  *
    +2114  * @description
    +2115  * This class represents TBSCertList of CRL defined in
    +2116  * <a href="https://tools.ietf.org/html/rfc5280#section-5.1">
    +2117  * RFC 5280 5.1</a>.
    +2118  * <pre>
    +2119  * TBSCertList  ::=  SEQUENCE  {
    +2120  *       version                 Version OPTIONAL,
    +2121  *                                    -- if present, MUST be v2
    +2122  *       signature               AlgorithmIdentifier,
    +2123  *       issuer                  Name,
    +2124  *       thisUpdate              Time,
    +2125  *       nextUpdate              Time OPTIONAL,
    +2126  *       revokedCertificates     SEQUENCE OF SEQUENCE  {
    +2127  *            userCertificate         CertificateSerialNumber,
    +2128  *            revocationDate          Time,
    +2129  *            crlEntryExtensions      Extensions OPTIONAL
    +2130  *                                     -- if present, version MUST be v2
    +2131  *                                 }  OPTIONAL,
    +2132  *       crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    +2133  * }
    +2134  * </pre>
    +2135  * NOTE: TBSCertList class is updated without backward 
    +2136  * compatibility from jsrsasign 9.1.0 asn1x509 2.1.0.
    +2137  * Most of methods are removed and parameters can be set
    +2138  * by JSON object.
    +2139  * <br/>
    +2140  * Constructor of this class may have following parameters:
    +2141  * <ul>
    +2142  * <li>{Integer}version (OPTION) - version number. Omitted by default.</li>
    +2143  * <li>{String}sigalg - signature algorithm name</li>
    +2144  * <li>{Array}issuer - issuer parameter of {@link KJUR.asn1.x509.X500Name}</li>
    +2145  * <li>{String}thisupdate - thisUpdate field value</li>
    +2146  * <li>{String}nextupdate (OPTION) - thisUpdate field value</li>
    +2147  * <li>{Array}revcert (OPTION) - revokedCertificates field value as array
    +2148  *   Its element may have following property:
    +2149  *   <ul>
    +2150  *   <li>{Array}sn - serialNumber of userCertificate field specified
    +2151  *   by {@link KJUR.asn1.DERInteger}</li>
    +2152  *   <li>{String}date - revocationDate field specified by
    +2153  *   a string of {@link KJUR.asn1.x509.Time} parameter</li>
    +2154  *   <li>{Array}ext (OPTION) - array of CRL entry extension parameter</li>
    +2155  *   </ul>
    +2156  * </li>
    +2157  * </ul>
    +2158  * 
    +2159  * @example
    +2160  * var o = new KJUR.asn1.x509.TBSCertList({
    +2161  *  sigalg: "SHA256withRSA",
    +2162  *  issuer: {array: [[{type:'C',value:'JP',ds:'prn'}],
    +2163  *                   [{type:'O',value:'T1',ds:'prn'}]]},
    +2164  *  thisupdate: "200821235959Z",
    +2165  *  nextupdate: "200828235959Z", // OPTION
    +2166  *  revcert: [
    +2167  *   {sn: {hex: "12ab"}, date: "200401235959Z", ext: [{extname: "cRLReason", code:1}]},
    +2168  *   {sn: {hex: "12bc"}, date: "200405235959Z", ext: [{extname: "cRLReason", code:2}]}
    +2169  *  ],
    +2170  *  ext: [
    +2171  *   {extname: "cRLNumber", num: {'int': 8}},
    +2172  *   {extname: "authorityKeyIdentifier", "kid": {hex: "12ab"}}
    +2173  *  ]
    +2174  * });
    +2175  * o.getEncodedHex() → "30..."
    +2176  */
    +2177 KJUR.asn1.x509.TBSCertList = function(params) {
    +2178     KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);
    +2179     var	_KJUR = KJUR,
    +2180 	_KJUR_asn1 = _KJUR.asn1,
    +2181 	_DERInteger = _KJUR_asn1.DERInteger,
    +2182 	_DERSequence = _KJUR_asn1.DERSequence,
    +2183 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +2184 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +2185 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +2186 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    +2187 	_Time = _KJUR_asn1_x509.Time,
    +2188 	_Extensions = _KJUR_asn1_x509.Extensions,
    +2189 	_X500Name = _KJUR_asn1_x509.X500Name;
    +2190     this.params = null;
    +2191 
    +2192     /**
    +2193      * get array of ASN.1 object for extensions<br/>
    +2194      * @name setByParam
    +2195      * @memberOf KJUR.asn1.x509.TBSCertList#
    +2196      * @function
    +2197      * @param {Array} JSON object of TBSCertList parameters
    +2198      * @example
    +2199      * tbsc = new KJUR.asn1.x509.TBSCertificate();
    +2200      * tbsc.setByParam({version:3, serial:{hex:'1234...'},...});
    +2201      */
    +2202     this.setByParam = function(params) {
    +2203 	this.params = params;
    +2204     };
    +2205 
    +2206     /**
    +2207      * get DERSequence for revokedCertificates<br/>
    +2208      * @name getRevCertSequence
    +2209      * @memberOf KJUR.asn1.x509.TBSCertList#
    +2210      * @function
    +2211      * @return {@link KJUR.asn1.DERSequence} of revokedCertificates
    +2212      */
    +2213     this.getRevCertSequence = function() {
    +2214 	var a = [];
    +2215 	var aRevCert = this.params.revcert;
    +2216 	for (var i = 0; i < aRevCert.length; i++) {
    +2217 	    var aEntry = [
    +2218 		new _DERInteger(aRevCert[i].sn),
    +2219 		new _Time(aRevCert[i].date)
    +2220 	    ];
    +2221 	    if (aRevCert[i].ext != undefined) {
    +2222 		aEntry.push(new _Extensions(aRevCert[i].ext));
    +2223 	    }
    +2224 	    a.push(new _DERSequence({array: aEntry}));
    +2225 	}
    +2226 	return new _DERSequence({array: a});
    +2227     };
    +2228 
    +2229     this.getEncodedHex = function() {
    +2230 	var a = [];
    +2231 	var params = this.params;
    +2232 
    +2233 	if (params.version != undefined) {
    +2234 	    var version = params.version - 1; 
    +2235 	    var obj = new _DERInteger({'int': version});
    +2236 	    a.push(obj);
    +2237 	}
    +2238 
    +2239 	a.push(new _AlgorithmIdentifier({name: params.sigalg}));
    +2240 	a.push(new _X500Name(params.issuer));
    +2241 	a.push(new _Time(params.thisupdate));
    +2242 	if (params.nextupdate != undefined) 
    +2243 	    a.push(new _Time(params.nextupdate))
    +2244 	if (params.revcert != undefined) {
    +2245 	    a.push(this.getRevCertSequence());
    +2246 	}
    +2247 	if (params.ext != undefined) {
    +2248 	    var dExt = new _Extensions(params.ext);
    +2249 	    a.push(new _DERTaggedObject({tag:'a0',
    +2250 					 explicit:true,
    +2251 					 obj:dExt}));
    +2252 	}
    +2253 
    +2254 	var seq = new _DERSequence({array: a});
    +2255 	return seq.getEncodedHex();
    +2256     };
    +2257 
    +2258     if (params !== undefined) this.setByParam(params);
    +2259 };
    +2260 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList, KJUR.asn1.ASN1Object);
    +2261 
    +2262 /**
    +2263  * ASN.1 CRLEntry structure class for CRL (DEPRECATED)<br/>
    +2264  * @name KJUR.asn1.x509.CRLEntry
    +2265  * @class ASN.1 CRLEntry structure class for CRL
    +2266  * @param {Array} params JSON object for CRL entry parameter
    +2267  * @extends KJUR.asn1.ASN1Object
    +2268  * @since 1.0.3
    +2269  * @see KJUR.asn1.x509.TBSCertList
    +2270  * @deprecated since jsrsasign 9.1.0 asn1x509 2.1.0
    +2271  * @description
    +2272  * This class is to represent revokedCertificate in TBSCertList.
    +2273  * However this is no more used by TBSCertList since
    +2274  * jsrsasign 9.1.0. So this class have been deprecated in 
    +2275  * jsrsasign 9.1.0.
    +2276  * <pre>
    +2277  * revokedCertificates     SEQUENCE OF SEQUENCE  {
    +2278  *     userCertificate         CertificateSerialNumber,
    +2279  *     revocationDate          Time,
    +2280  *     crlEntryExtensions      Extensions OPTIONAL
    +2281  *                             -- if present, version MUST be v2 }
    +2282  * </pre>
    +2283  * @example
    +2284  * var e = new KJUR.asn1.x509.CRLEntry({'time': {'str': '130514235959Z'}, 'sn': {'int': 234}});
    +2285  */
    +2286 KJUR.asn1.x509.CRLEntry = function(params) {
    +2287     KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);
    +2288     var sn = null,
    +2289 	time = null,
    +2290 	_KJUR = KJUR,
    +2291 	_KJUR_asn1 = _KJUR.asn1;
    +2292 
    +2293     /**
    +2294      * set DERInteger parameter for serial number of revoked certificate
    +2295      * @name setCertSerial
    +2296      * @memberOf KJUR.asn1.x509.CRLEntry
    +2297      * @function
    +2298      * @param {Array} intParam DERInteger parameter for certificate serial number
    +2299      * @description
    +2300      * @example
    +2301      * entry.setCertSerial({'int': 3});
    +2302      */
    +2303     this.setCertSerial = function(intParam) {
    +2304         this.sn = new _KJUR_asn1.DERInteger(intParam);
    +2305     };
    +2306 
    +2307     /**
    +2308      * set Time parameter for revocation date
    +2309      * @name setRevocationDate
    +2310      * @memberOf KJUR.asn1.x509.CRLEntry
    +2311      * @function
    +2312      * @param {Array} timeParam Time parameter for revocation date
    +2313      * @description
    +2314      * @example
    +2315      * entry.setRevocationDate({'str': '130508235959Z'});
    +2316      */
    +2317     this.setRevocationDate = function(timeParam) {
    +2318         this.time = new _KJUR_asn1.x509.Time(timeParam);
    +2319     };
    +2320 
    +2321     this.getEncodedHex = function() {
    +2322         var o = new _KJUR_asn1.DERSequence({"array": [this.sn, this.time]});
    +2323         this.TLV = o.getEncodedHex();
    +2324         return this.TLV;
    +2325     };
    +2326 
    +2327     if (params !== undefined) {
    +2328         if (params.time !== undefined) {
    +2329             this.setRevocationDate(params.time);
    +2330         }
    +2331         if (params.sn !== undefined) {
    +2332             this.setCertSerial(params.sn);
    +2333         }
    +2334     }
    +2335 };
    +2336 YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry, KJUR.asn1.ASN1Object);
    +2337 
    +2338 /**
    +2339  * CRLNumber CRL extension ASN.1 structure class<br/>
    +2340  * @name KJUR.asn1.x509.CRLNumber
    +2341  * @class CRLNumber CRL extension ASN.1 structure class
    +2342  * @extends KJUR.asn1.x509.Extension
    +2343  * @since jsrsasign 9.1.0 asn1x509 2.1.0
    +2344  * @see KJUR.asn1.x509.TBSCertList
    +2345  * @see KJUR.asn1.x509.Extensions
    +2346  * @description
    +2347  * This class represents ASN.1 structure for
    +2348  * CRLNumber CRL extension defined in
    +2349  * <a href="https://tools.ietf.org/html/rfc5280#section-5.2.3">
    +2350  * RFC 5280 5.2.3</a>.
    +2351  * <pre>
    +2352  * id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 }
    +2353  * CRLNumber ::= INTEGER (0..MAX)
    +2354  * </pre>
    +2355  * Constructor of this class may have following parameters:
    +2356  * <ul>
    +2357  * <li>{String}extname - name "cRLNumber". It is ignored in this class but
    +2358  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    +2359  * <li>{Object}num - CRLNumber value to specify
    +2360  * {@link KJUR.asn1.DERInteger} parameter.</li>
    +2361  * <li>{Boolean}critical - critical flag. Generally false and not specified
    +2362  * in this class.(OPTION)</li>
    +2363  * </ul>
    +2364  *
    +2365  * @example
    +2366  * new KJUR.asn1.x509.CRLNumber({extname:'cRLNumber',
    +2367  *                               num:{'int':147}})
    +2368  */
    +2369 KJUR.asn1.x509.CRLNumber = function(params) {
    +2370     KJUR.asn1.x509.CRLNumber.superclass.constructor.call(this, params);
    +2371     this.params = undefined;
    +2372 
    +2373     this.getExtnValueHex = function() {
    +2374         this.asn1ExtnValue = new KJUR.asn1.DERInteger(this.params.num);
    +2375         return this.asn1ExtnValue.getEncodedHex();
    +2376     };
    +2377 
    +2378     this.oid = "2.5.29.20";
    +2379     if (params != undefined) this.params = params;
    +2380 };
    +2381 YAHOO.lang.extend(KJUR.asn1.x509.CRLNumber, KJUR.asn1.x509.Extension);
    +2382 
    +2383 /**
    +2384  * CRLReason CRL entry extension ASN.1 structure class<br/>
    +2385  * @name KJUR.asn1.x509.CRLReason
    +2386  * @class CRLReason CRL entry extension ASN.1 structure class
    +2387  * @extends KJUR.asn1.x509.Extension
    +2388  * @since jsrsasign 9.1.0 asn1x509 2.1.0
    +2389  * @see KJUR.asn1.x509.TBSCertList
    +2390  * @see KJUR.asn1.x509.Extensions
    +2391  * @description
    +2392  * This class represents ASN.1 structure for
    +2393  * CRLReason CRL entry extension defined in
    +2394  * <a href="https://tools.ietf.org/html/rfc5280#section-5.3.1">
    +2395  * RFC 5280 5.3.1</a>
    +2396  * <pre>
    +2397  * id-ce-cRLReasons OBJECT IDENTIFIER ::= { id-ce 21 }
    +2398  * -- reasonCode ::= { CRLReason }
    +2399  * CRLReason ::= ENUMERATED {
    +2400  *      unspecified             (0),
    +2401  *      keyCompromise           (1),
    +2402  *      cACompromise            (2),
    +2403  *      affiliationChanged      (3),
    +2404  *      superseded              (4),
    +2405  *      cessationOfOperation    (5),
    +2406  *      certificateHold         (6),
    +2407  *      removeFromCRL           (8),
    +2408  *      privilegeWithdrawn      (9),
    +2409  *      aACompromise           (10) }
    +2410  * </pre>
    +2411  * Constructor of this class may have following parameters:
    +2412  * <ul>
    +2413  * <li>{String}extname - name "cRLReason". It is ignored in this class but
    +2414  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    +2415  * <li>{Integer}code - reasonCode value</li>
    +2416  * <li>{Boolean}critical - critical flag. Generally false and not specified
    +2417  * in this class.(OPTION)</li>
    +2418  * </ul>
    +2419  *
    +2420  * @example
    +2421  * new KJUR.asn1.x509.CRLReason({extname:'cRLNumber',code:4})
    +2422  */
    +2423 KJUR.asn1.x509.CRLReason = function(params) {
    +2424     KJUR.asn1.x509.CRLReason.superclass.constructor.call(this, params);
    +2425     this.params = undefined;
    +2426 
    +2427     this.getExtnValueHex = function() {
    +2428         this.asn1ExtnValue = new KJUR.asn1.DEREnumerated(this.params.code);
    +2429         return this.asn1ExtnValue.getEncodedHex();
    +2430     };
    +2431 
    +2432     this.oid = "2.5.29.21";
    +2433     if (params != undefined) this.params = params;
    +2434 };
    +2435 YAHOO.lang.extend(KJUR.asn1.x509.CRLReason, KJUR.asn1.x509.Extension);
     2436 
    -2437 // === BEGIN OCSP Related ===================================================
    -2438 /**
    -2439  * Nonce OCSP extension ASN.1 structure class<br/>
    -2440  * @name KJUR.asn1.x509.OCSPNonce
    -2441  * @class Nonce OCSP extension ASN.1 structure class
    -2442  * @extends KJUR.asn1.x509.Extension
    -2443  * @since jsrsasign 9.1.6 asn1x509 2.1.2
    -2444  * @param {Array} params JSON object for Nonce extension
    -2445  * @see KJUR.asn1.ocsp.ResponseData
    -2446  * @see KJUR.asn1.x509.Extensions
    -2447  * @see X509#getExtOCSPNonce
    -2448  * @description
    -2449  * This class represents
    -2450  * Nonce OCSP extension value defined in
    -2451  * <a href="https://tools.ietf.org/html/rfc6960#section-4.4.1">
    -2452  * RFC 6960 4.4.1</a> as JSON object.
    -2453  * <pre>
    -2454  * id-pkix-ocsp           OBJECT IDENTIFIER ::= { id-ad-ocsp }
    -2455  * id-pkix-ocsp-nonce     OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }
    -2456  * Nonce ::= OCTET STRING
    -2457  * </pre>
    -2458  * Constructor of this class may have following parameters:
    -2459  * <ul>
    -2460  * <li>{String}extname - name "ocspNonce". It is ignored in this class but
    -2461  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    -2462  * <li>{String}hex - hexadecimal string of nonce value</li>
    -2463  * <li>{Number}int - integer of nonce value. "hex" or "int" needs to be
    -2464  * specified.</li>
    -2465  * <li>{Boolean}critical - critical flag. Generally false and not specified
    -2466  * in this class.(OPTION)</li>
    -2467  * </ul>
    -2468  *
    -2469  * @example
    -2470  * new KJUR.asn1.x509.OCSPNonce({extname:'ocspNonce',
    -2471  *                               hex: '12ab...'})
    -2472  */
    -2473 KJUR.asn1.x509.OCSPNonce = function(params) {
    -2474     KJUR.asn1.x509.OCSPNonce.superclass.constructor.call(this, params);
    -2475     this.params = undefined;
    -2476 
    -2477     this.getExtnValueHex = function() {
    -2478         this.asn1ExtnValue = new KJUR.asn1.DEROctetString(this.params);
    -2479         return this.asn1ExtnValue.getEncodedHex();
    -2480     };
    -2481 
    -2482     this.oid = "1.3.6.1.5.5.7.48.1.2";
    -2483     if (params != undefined) this.params = params;
    -2484 };
    -2485 YAHOO.lang.extend(KJUR.asn1.x509.OCSPNonce, KJUR.asn1.x509.Extension);
    -2486 
    -2487 /**
    -2488  * OCSPNoCheck certificate ASN.1 structure class<br/>
    -2489  * @name KJUR.asn1.x509.OCSPNoCheck
    -2490  * @class OCSPNoCheck extension ASN.1 structure class
    -2491  * @extends KJUR.asn1.x509.Extension
    -2492  * @since jsrsasign 9.1.6 asn1x509 2.1.2
    -2493  * @param {Array} params JSON object for OCSPNoCheck extension
    -2494  * @see KJUR.asn1.x509.Extensions
    -2495  * @see X509#getExtOCSPNoCheck
    -2496  * @description
    -2497  * This class represents
    -2498  * OCSPNoCheck extension value defined in
    -2499  * <a href="https://tools.ietf.org/html/rfc6960#section-4.2.2.2.1">
    -2500  * RFC 6960 4.2.2.2.1</a> as JSON object.
    -2501  * <pre>
    -2502  * id-pkix-ocsp-nocheck OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 }
    -2503  * </pre>
    -2504  * Constructor of this class may have following parameters:
    -2505  * <ul>
    -2506  * <li>{String}extname - name "ocspNoCheck". It is ignored in this class but
    -2507  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    -2508  * <li>{Boolean}critical - critical flag. Generally false and not specified
    -2509  * in this class.(OPTION)</li>
    -2510  * </ul>
    -2511  *
    -2512  * @example
    -2513  * new KJUR.asn1.x509.OCSPNonce({extname:'ocspNoCheck'})
    -2514  */
    -2515 KJUR.asn1.x509.OCSPNoCheck = function(params) {
    -2516     KJUR.asn1.x509.OCSPNoCheck.superclass.constructor.call(this, params);
    -2517     this.params = undefined;
    -2518 
    -2519     this.getExtnValueHex = function() {
    -2520         this.asn1ExtnValue = new KJUR.asn1.DERNull();
    -2521         return this.asn1ExtnValue.getEncodedHex();
    -2522     };
    -2523 
    -2524     this.oid = "1.3.6.1.5.5.7.48.1.5";
    -2525     if (params != undefined) this.params = params;
    -2526 };
    -2527 YAHOO.lang.extend(KJUR.asn1.x509.OCSPNoCheck, KJUR.asn1.x509.Extension);
    -2528 
    -2529 // === END   OCSP Related ===================================================
    +2437 // === END   CRL Related ===================================================
    +2438 
    +2439 // === BEGIN OCSP Related ===================================================
    +2440 /**
    +2441  * Nonce OCSP extension ASN.1 structure class<br/>
    +2442  * @name KJUR.asn1.x509.OCSPNonce
    +2443  * @class Nonce OCSP extension ASN.1 structure class
    +2444  * @extends KJUR.asn1.x509.Extension
    +2445  * @since jsrsasign 9.1.6 asn1x509 2.1.2
    +2446  * @param {Array} params JSON object for Nonce extension
    +2447  * @see KJUR.asn1.ocsp.ResponseData
    +2448  * @see KJUR.asn1.x509.Extensions
    +2449  * @see X509#getExtOCSPNonce
    +2450  * @description
    +2451  * This class represents
    +2452  * Nonce OCSP extension value defined in
    +2453  * <a href="https://tools.ietf.org/html/rfc6960#section-4.4.1">
    +2454  * RFC 6960 4.4.1</a> as JSON object.
    +2455  * <pre>
    +2456  * id-pkix-ocsp           OBJECT IDENTIFIER ::= { id-ad-ocsp }
    +2457  * id-pkix-ocsp-nonce     OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }
    +2458  * Nonce ::= OCTET STRING
    +2459  * </pre>
    +2460  * Constructor of this class may have following parameters:
    +2461  * <ul>
    +2462  * <li>{String}extname - name "ocspNonce". It is ignored in this class but
    +2463  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    +2464  * <li>{String}hex - hexadecimal string of nonce value</li>
    +2465  * <li>{Number}int - integer of nonce value. "hex" or "int" needs to be
    +2466  * specified.</li>
    +2467  * <li>{Boolean}critical - critical flag. Generally false and not specified
    +2468  * in this class.(OPTION)</li>
    +2469  * </ul>
    +2470  *
    +2471  * @example
    +2472  * new KJUR.asn1.x509.OCSPNonce({extname:'ocspNonce',
    +2473  *                               hex: '12ab...'})
    +2474  */
    +2475 KJUR.asn1.x509.OCSPNonce = function(params) {
    +2476     KJUR.asn1.x509.OCSPNonce.superclass.constructor.call(this, params);
    +2477     this.params = undefined;
    +2478 
    +2479     this.getExtnValueHex = function() {
    +2480         this.asn1ExtnValue = new KJUR.asn1.DEROctetString(this.params);
    +2481         return this.asn1ExtnValue.getEncodedHex();
    +2482     };
    +2483 
    +2484     this.oid = "1.3.6.1.5.5.7.48.1.2";
    +2485     if (params != undefined) this.params = params;
    +2486 };
    +2487 YAHOO.lang.extend(KJUR.asn1.x509.OCSPNonce, KJUR.asn1.x509.Extension);
    +2488 
    +2489 /**
    +2490  * OCSPNoCheck certificate ASN.1 structure class<br/>
    +2491  * @name KJUR.asn1.x509.OCSPNoCheck
    +2492  * @class OCSPNoCheck extension ASN.1 structure class
    +2493  * @extends KJUR.asn1.x509.Extension
    +2494  * @since jsrsasign 9.1.6 asn1x509 2.1.2
    +2495  * @param {Array} params JSON object for OCSPNoCheck extension
    +2496  * @see KJUR.asn1.x509.Extensions
    +2497  * @see X509#getExtOCSPNoCheck
    +2498  * @description
    +2499  * This class represents
    +2500  * OCSPNoCheck extension value defined in
    +2501  * <a href="https://tools.ietf.org/html/rfc6960#section-4.2.2.2.1">
    +2502  * RFC 6960 4.2.2.2.1</a> as JSON object.
    +2503  * <pre>
    +2504  * id-pkix-ocsp-nocheck OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 }
    +2505  * </pre>
    +2506  * Constructor of this class may have following parameters:
    +2507  * <ul>
    +2508  * <li>{String}extname - name "ocspNoCheck". It is ignored in this class but
    +2509  * required to use with {@link KJUR.asn1.x509.Extensions} class. (OPTION)</li>
    +2510  * <li>{Boolean}critical - critical flag. Generally false and not specified
    +2511  * in this class.(OPTION)</li>
    +2512  * </ul>
    +2513  *
    +2514  * @example
    +2515  * new KJUR.asn1.x509.OCSPNonce({extname:'ocspNoCheck'})
    +2516  */
    +2517 KJUR.asn1.x509.OCSPNoCheck = function(params) {
    +2518     KJUR.asn1.x509.OCSPNoCheck.superclass.constructor.call(this, params);
    +2519     this.params = undefined;
    +2520 
    +2521     this.getExtnValueHex = function() {
    +2522         this.asn1ExtnValue = new KJUR.asn1.DERNull();
    +2523         return this.asn1ExtnValue.getEncodedHex();
    +2524     };
    +2525 
    +2526     this.oid = "1.3.6.1.5.5.7.48.1.5";
    +2527     if (params != undefined) this.params = params;
    +2528 };
    +2529 YAHOO.lang.extend(KJUR.asn1.x509.OCSPNoCheck, KJUR.asn1.x509.Extension);
     2530 
    -2531 // === BEGIN X500Name Related =================================================
    -2532 /**
    -2533  * X500Name ASN.1 structure class
    -2534  * @name KJUR.asn1.x509.X500Name
    -2535  * @class X500Name ASN.1 structure class
    -2536  * @param {Array} params associative array of parameters (ex. {'str': '/C=US/O=a'})
    -2537  * @extends KJUR.asn1.ASN1Object
    -2538  * @see KJUR.asn1.x509.X500Name
    -2539  * @see KJUR.asn1.x509.RDN
    -2540  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -2541  * @see X509#getX500Name
    -2542  * @description
    -2543  * This class provides DistinguishedName ASN.1 class structure
    -2544  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    -2545  * <blockquote><pre>
    -2546  * DistinguishedName ::= RDNSequence
    -2547  * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    -2548  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    -2549  *   AttributeTypeAndValue
    -2550  * AttributeTypeAndValue ::= SEQUENCE {
    -2551  *   type  AttributeType,
    -2552  *   value AttributeValue }
    -2553  * </pre></blockquote>
    -2554  * <br/>
    -2555  * Argument for the constructor can be one of following parameters:
    -2556  * <ul>
    -2557  * <li>{Array}array - array of {@link KJUR.asn1.x509.RDN} parameter</li>
    -2558  * <li>`String}str - string for distingish name in OpenSSL One line foramt (ex: /C=US/O=test/CN=test) See <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">this</a> in detail.</li>
    -2559  * <li>{String}ldapstr - string for distinguish name in LDAP format (ex: CN=test,O=test,C=US)</li>
    -2560  * <li>{String}hex - hexadecimal string for ASN.1 distinguish name structure</li>
    -2561  * <li>{String}certissuer - issuer name in the specified PEM certificate</li>
    -2562  * <li>{String}certsubject - subject name in the specified PEM certificate</li>
    -2563  * <li>{String}rule - DirectoryString rule (ex. "prn" or "utf8")</li>
    -2564  * </ul>
    -2565  * <br/>
    -2566  * NOTE1: The "array" and "rule" parameters have been supported
    -2567  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    -2568  * <br/>
    -2569  * NOTE2: Multi-valued RDN in "str" parameter have been
    -2570  * supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    -2571  * @example
    -2572  * // 1. construct with array
    -2573  * new KJUR.asn1.x509.X500Name({array:[
    -2574  *   [{type:'C',value:'JP',ds:'prn'}],
    -2575  *   [{type:'O',value:'aaa',ds:'utf8'}, // multi-valued RDN
    -2576  *    {type:'CN',value:'bob@example.com',ds:'ia5'}]
    -2577  * ]})
    -2578 : "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    -2579  * // 2. construct with string
    -2580  * new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    -2581  * // 3. construct by LDAP string
    -2582  * new KJUR.asn1.x509.X500Name({ldapstr: "CN=foo@example.com,OU=bbb,C=US"});
    -2583  * // 4. construct by ASN.1 hex string
    -2584  * new KJUR.asn1.x509.X500Name({hex: "304c3120..."});
    -2585  * // 5. construct by issuer of PEM certificate
    -2586  * new KJUR.asn1.x509.X500Name({certsubject: "-----BEGIN CERT..."});
    -2587  * // 6. construct by subject of PEM certificate
    -2588  * new KJUR.asn1.x509.X500Name({certissuer: "-----BEGIN CERT..."});
    -2589  * // 7. construct by object (DEPRECATED)
    -2590  * new KJUR.asn1.x509.X500Name({C:"US",O:"aaa",CN:"http://example.com/"});
    -2591  */
    -2592 KJUR.asn1.x509.X500Name = function(params) {
    -2593     KJUR.asn1.x509.X500Name.superclass.constructor.call(this);
    -2594     this.asn1Array = [];
    -2595     this.paramArray = [];
    -2596     this.sRule = "utf8";
    -2597     var _KJUR = KJUR,
    -2598 	_KJUR_asn1 = _KJUR.asn1,
    -2599 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -2600 	_RDN = _KJUR_asn1_x509.RDN,
    -2601 	_pemtohex = pemtohex;
    -2602 
    -2603     /**
    -2604      * set DN by OpenSSL oneline distinguished name string<br/>
    -2605      * @name setByString
    -2606      * @memberOf KJUR.asn1.x509.X500Name#
    -2607      * @function
    -2608      * @param {String} dnStr distinguished name by string (ex. /C=US/O=aaa)
    -2609      * @description
    -2610      * Sets distinguished name by string. 
    -2611      * dnStr must be formatted as 
    -2612      * "/type0=value0/type1=value1/type2=value2...".
    -2613      * No need to escape a slash in an attribute value.
    -2614      * @example
    -2615      * name = new KJUR.asn1.x509.X500Name();
    -2616      * name.setByString("/C=US/O=aaa/OU=bbb/CN=foo@example.com");
    -2617      * // no need to escape slash in an attribute value
    -2618      * name.setByString("/C=US/O=aaa/CN=1980/12/31");
    -2619      */
    -2620     this.setByString = function(dnStr, sRule) {
    -2621 	if (sRule !== undefined) this.sRule = sRule;
    -2622         var a = dnStr.split('/');
    -2623         a.shift();
    -2624 
    -2625 	var a1 = [];
    -2626 	for (var i = 0; i < a.length; i++) {
    -2627 	  if (a[i].match(/^[^=]+=.+$/)) {
    -2628 	    a1.push(a[i]);
    -2629 	  } else {
    -2630 	    var lastidx = a1.length - 1;
    -2631 	    a1[lastidx] = a1[lastidx] + "/" + a[i];
    -2632 	  }
    -2633 	}
    -2634 
    -2635         for (var i = 0; i < a1.length; i++) {
    -2636             this.asn1Array.push(new _RDN({'str':a1[i], rule:this.sRule}));
    -2637         }
    -2638     };
    -2639 
    -2640     /**
    -2641      * set DN by LDAP(RFC 2253) distinguished name string<br/>
    -2642      * @name setByLdapString
    -2643      * @memberOf KJUR.asn1.x509.X500Name#
    -2644      * @function
    -2645      * @param {String} dnStr distinguished name by LDAP string (ex. O=aaa,C=US)
    -2646      * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -2647      * @see {@link KJUR.asn1.x509.X500Name.ldapToCompat}
    -2648      * @description
    -2649      * @example
    -2650      * name = new KJUR.asn1.x509.X500Name();
    -2651      * name.setByLdapString("CN=foo@example.com,OU=bbb,O=aaa,C=US");
    -2652      */
    -2653     this.setByLdapString = function(dnStr, sRule) {
    -2654 	if (sRule !== undefined) this.sRule = sRule;
    -2655 	var compat = _KJUR_asn1_x509.X500Name.ldapToCompat(dnStr);
    -2656 	this.setByString(compat, sRule);
    -2657     };
    -2658 
    -2659     /**
    -2660      * set DN by associative array<br/>
    -2661      * @name setByObject
    -2662      * @memberOf KJUR.asn1.x509.X500Name#
    -2663      * @function
    -2664      * @param {Array} dnObj associative array of DN (ex. {C: "US", O: "aaa"})
    -2665      * @since jsrsasign 4.9. asn1x509 1.0.13
    -2666      * @description
    -2667      * @example
    -2668      * name = new KJUR.asn1.x509.X500Name();
    -2669      * name.setByObject({C: "US", O: "aaa", CN="http://example.com/"1});
    -2670      */
    -2671     this.setByObject = function(dnObj, sRule) {
    -2672 	if (sRule !== undefined) this.sRule = sRule;
    -2673 
    -2674         // Get all the dnObject attributes and stuff them in the ASN.1 array.
    -2675         for (var x in dnObj) {
    -2676             if (dnObj.hasOwnProperty(x)) {
    -2677                 var newRDN = new _RDN({str: x + '=' + dnObj[x], rule: this.sRule});
    -2678                 // Initialize or push into the ANS1 array.
    -2679                 this.asn1Array ? this.asn1Array.push(newRDN)
    -2680                     : this.asn1Array = [newRDN];
    -2681             }
    -2682         }
    -2683     };
    -2684 
    -2685     this.setByParam = function(params) {
    -2686 	if (params.rule !== undefined) this.sRule = params.rule;
    -2687 
    -2688 	if (params.array !== undefined) {
    -2689 	    this.paramArray = params.array;
    -2690 	} else {
    -2691             if (params.str !== undefined) {
    -2692 		this.setByString(params.str);
    -2693             } else if (params.ldapstr !== undefined) {
    -2694 		this.setByLdapString(params.ldapstr);
    -2695 	    } else if (params.hex !== undefined) {
    -2696 		this.hTLV = params.hex;
    -2697             } else if (params.certissuer !== undefined) {
    -2698 		var x = new X509();
    -2699 		x.readCertPEM(params.certissuer);
    -2700 		this.hTLV = x.getIssuerHex();
    -2701             } else if (params.certsubject !== undefined) {
    -2702 		var x = new X509();
    -2703 		x.readCertPEM(params.certsubject);
    -2704 		this.hTLV = x.getSubjectHex();
    -2705 		// If params is an object, then set the ASN1 array
    -2706 		// just using the object attributes. 
    -2707 		// This is nice for fields that have lots of special
    -2708 		// characters (i.e. CN: 'https://www.github.com/kjur//').
    -2709             } else if (typeof params === "object" &&
    -2710 		       params.certsubject === undefined &&
    -2711 		       params.certissuer === undefined) {
    -2712 		this.setByObject(params);
    -2713             }
    -2714 	}
    -2715     }
    -2716 
    -2717     this.getEncodedHex = function() {
    -2718         if (typeof this.hTLV == "string") return this.hTLV;
    -2719 
    -2720 	if (this.asn1Array.length == 0 && this.paramArray.length > 0) {
    -2721 	    for (var i = 0; i < this.paramArray.length; i++) {
    -2722 		var param = {array: this.paramArray[i]};
    -2723 		if (this.sRule != "utf8") param.rule = this.sRule;
    -2724 		var asn1RDN = new _RDN(param);
    -2725 		this.asn1Array.push(asn1RDN);
    -2726 	    }
    -2727 	}
    -2728 
    -2729         var o = new _KJUR_asn1.DERSequence({"array": this.asn1Array});
    -2730         this.hTLV = o.getEncodedHex();
    -2731         return this.hTLV;
    -2732     };
    -2733 
    -2734     if (params !== undefined) this.setByParam(params);
    -2735 };
    -2736 YAHOO.lang.extend(KJUR.asn1.x509.X500Name, KJUR.asn1.ASN1Object);
    -2737 
    -2738 /**
    -2739  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format<br/>
    -2740  * @name compatToLDAP
    -2741  * @memberOf KJUR.asn1.x509.X500Name
    -2742  * @function
    -2743  * @param {String} s distinguished name string in OpenSSL oneline compat (ex. /C=US/O=test)
    -2744  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -2745  * @since jsrsasign 8.0.19 asn1x509 1.1.20
    -2746  * @description
    -2747  * This static method converts a distinguished name string in OpenSSL compat
    -2748  * format to LDAP(RFC 2253) format.
    -2749  * @see <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">jsrsasign wiki: distinguished name string difference between OpenSSL compat and LDAP(RFC 2253)</a>
    -2750  * @see <a href="https://www.openssl.org/docs/man1.0.2/man1/openssl-x509.html#NAME-OPTIONS">OpenSSL x509 command manual - NAME OPTIONS</a>
    -2751  * @example
    -2752  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=test") → 'O=test,C=US'
    -2753  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=a,a") → 'O=a\,a,C=US'
    -2754  */
    -2755 KJUR.asn1.x509.X500Name.compatToLDAP = function(s) {
    -2756     if (s.substr(0, 1) !== "/") throw "malformed input";
    -2757 
    -2758     var result = "";
    -2759     s = s.substr(1);
    -2760 
    -2761     var a = s.split("/");
    -2762     a.reverse();
    -2763     a = a.map(function(s) {return s.replace(/,/, "\\,")});
    -2764 
    -2765     return a.join(",");
    -2766 };
    -2767 
    -2768 /**
    -2769  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format (DEPRECATED)<br/>
    -2770  * @name onelineToLDAP
    -2771  * @memberOf KJUR.asn1.x509.X500Name
    -2772  * @function
    -2773  * @param {String} s distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -2774  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -2775  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -2776  * @see KJUR.asn1.x509.X500Name.compatToLDAP
    -2777  * @description
    -2778  * This method is deprecated. Please use 
    -2779  * {@link KJUR.asn1.x509.X500Name.compatToLDAP} instead.
    -2780  */
    -2781 KJUR.asn1.x509.X500Name.onelineToLDAP = function(s) {
    -2782     return KJUR.asn1.x509.X500Name.compatToLDAP(s);
    -2783 }
    -2784 
    -2785 /**
    -2786  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format<br/>
    -2787  * @name ldapToCompat
    -2788  * @memberOf KJUR.asn1.x509.X500Name
    -2789  * @function
    -2790  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -2791  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -2792  * @since jsrsasign 8.0.19 asn1x509 1.1.10
    -2793  * @description
    -2794  * This static method converts a distinguished name string in 
    -2795  * LDAP(RFC 2253) format to OpenSSL compat format.
    -2796  * @see <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">jsrsasign wiki: distinguished name string difference between OpenSSL compat and LDAP(RFC 2253)</a>
    -2797  * @example
    -2798  * KJUR.asn1.x509.X500Name.ldapToCompat('O=test,C=US') → '/C=US/O=test'
    -2799  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a\,a,C=US') → '/C=US/O=a,a'
    -2800  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a/a,C=US')  → '/C=US/O=a\/a'
    -2801  */
    -2802 KJUR.asn1.x509.X500Name.ldapToCompat = function(s) {
    -2803     var a = s.split(",");
    -2804 
    -2805     // join \,
    -2806     var isBSbefore = false;
    -2807     var a2 = [];
    -2808     for (var i = 0; a.length > 0; i++) {
    -2809 	var item = a.shift();
    -2810 	//console.log("item=" + item);
    -2811 
    -2812 	if (isBSbefore === true) {
    -2813 	    var a2last = a2.pop();
    -2814 	    var newitem = (a2last + "," + item).replace(/\\,/g, ",");
    -2815 	    a2.push(newitem);
    -2816 	    isBSbefore = false;
    -2817 	} else {
    -2818 	    a2.push(item);
    -2819 	}
    -2820 
    -2821 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    -2822     }
    -2823 
    -2824     a2 = a2.map(function(s) {return s.replace("/", "\\/")});
    -2825     a2.reverse();
    -2826     return "/" + a2.join("/");
    -2827 };
    -2828 
    -2829 /**
    -2830  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format (DEPRECATED)<br/>
    -2831  * @name ldapToOneline
    -2832  * @memberOf KJUR.asn1.x509.X500Name
    -2833  * @function
    -2834  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -2835  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -2836  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -2837  * @description
    -2838  * This method is deprecated. Please use 
    -2839  * {@link KJUR.asn1.x509.X500Name.ldapToCompat} instead.
    -2840  */
    -2841 KJUR.asn1.x509.X500Name.ldapToOneline = function(s) {
    -2842     return KJUR.asn1.x509.X500Name.ldapToCompat(s);
    -2843 };
    -2844 
    -2845 /**
    -2846  * RDN (Relative Distinguished Name) ASN.1 structure class
    -2847  * @name KJUR.asn1.x509.RDN
    -2848  * @class RDN (Relative Distinguished Name) ASN.1 structure class
    -2849  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    -2850  * @extends KJUR.asn1.ASN1Object
    -2851  * @see KJUR.asn1.x509.X500Name
    -2852  * @see KJUR.asn1.x509.RDN
    -2853  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -2854  * @description
    -2855  * This class provides RelativeDistinguishedName ASN.1 class structure
    -2856  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    -2857  * <blockquote><pre>
    -2858  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    -2859  *   AttributeTypeAndValue
    -2860  *
    -2861  * AttributeTypeAndValue ::= SEQUENCE {
    -2862  *   type  AttributeType,
    -2863  *   value AttributeValue }
    -2864  * </pre></blockquote>
    -2865  * <br/>
    -2866  * NOTE1: The "array" and "rule" parameters have been supported
    -2867  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    -2868  * <br/>
    -2869  * NOTE2: Multi-valued RDN in "str" parameter have been
    -2870  * supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    -2871  * @example
    -2872  * new KJUR.asn1.x509.RDN({array: [ // multi-valued
    -2873  *    {type:"CN",value:"Bob",ds:"prn"},
    -2874  *    {type:"CN",value:"bob@example.com", ds:"ia5"}
    -2875  * ]});
    -2876  * new KJUR.asn1.x509.RDN({str: "CN=test"});
    -2877  * new KJUR.asn1.x509.RDN({str: "O=a+O=bb+O=c"}); // multi-valued
    -2878  * new KJUR.asn1.x509.RDN({str: "O=a+O=b\\+b+O=c"}); // plus escaped
    -2879  * new KJUR.asn1.x509.RDN({str: "O=a+O=\"b+b\"+O=c"}); // double quoted
    -2880  */
    -2881 KJUR.asn1.x509.RDN = function(params) {
    -2882     KJUR.asn1.x509.RDN.superclass.constructor.call(this);
    -2883     this.asn1Array = [];
    -2884     this.paramArray = [];
    -2885     this.sRule = "utf8"; // DEFAULT "utf8"
    -2886     var _AttributeTypeAndValue = KJUR.asn1.x509.AttributeTypeAndValue;
    -2887 
    -2888     this.setByParam = function(params) {
    -2889 	if (params.rule !== undefined) this.sRule = params.rule;
    -2890         if (params.str !== undefined) {
    -2891             this.addByMultiValuedString(params.str);
    -2892         }
    -2893 	if (params.array !== undefined) this.paramArray = params.array;
    -2894     };
    -2895 
    -2896     /**
    -2897      * add one AttributeTypeAndValue by string<br/>
    -2898      * @name addByString
    -2899      * @memberOf KJUR.asn1.x509.RDN#
    -2900      * @function
    -2901      * @param {String} s string of AttributeTypeAndValue
    -2902      * @return {Object} unspecified
    -2903      * @description
    -2904      * This method add one AttributeTypeAndValue to RDN object.
    -2905      * @example
    -2906      * rdn = new KJUR.asn1.x509.RDN();
    -2907      * rdn.addByString("CN=john");
    -2908      * rdn.addByString("serialNumber=1234"); // for multi-valued RDN
    -2909      */
    -2910     this.addByString = function(s) {
    -2911         this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({'str': s, rule: this.sRule}));
    -2912     };
    +2531 // === END   OCSP Related ===================================================
    +2532 
    +2533 // === BEGIN Other X.509v3 Extensions========================================
    +2534 
    +2535 /**
    +2536  * AdobeTimeStamp X.509v3 extension ASN.1 encoder class<br/>
    +2537  * @name KJUR.asn1.x509.AdobeTimeStamp
    +2538  * @class AdobeTimeStamp X.509v3 extension ASN.1 encoder class
    +2539  * @extends KJUR.asn1.x509.Extension
    +2540  * @since jsrsasign 10.0.1 asn1x509 2.1.4
    +2541  * @param {Array} params JSON object for AdobeTimeStamp extension parameter
    +2542  * @see KJUR.asn1.x509.Extensions
    +2543  * @see X509#getExtAdobeTimeStamp
    +2544  * @description
    +2545  * This class represents
    +2546  * AdobeTimeStamp X.509v3 extension value defined in
    +2547  * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSigDC/oids.html">
    +2548  * Adobe site</a> as JSON object.
    +2549  * <pre>
    +2550  * adbe- OBJECT IDENTIFIER ::=  { adbe(1.2.840.113583) acrobat(1) security(1) x509Ext(9) 1 }
    +2551  *  ::= SEQUENCE {
    +2552  *     version INTEGER  { v1(1) }, -- extension version
    +2553  *     location GeneralName (In v1 GeneralName can be only uniformResourceIdentifier)
    +2554  *     requiresAuth        boolean (default false), OPTIONAL }
    +2555  * </pre>
    +2556  * Constructor of this class may have following parameters:
    +2557  * <ul>
    +2558  * <li>{String}uri - RFC 3161 time stamp service URL</li>
    +2559  * <li>{Boolean}reqauth - authentication required or not</li>
    +2560  * </ul>
    +2561  * </pre>
    +2562  * @example
    +2563  * new KJUR.asn1.x509.AdobeTimesStamp({
    +2564  *   uri: "http://tsa.example.com/",
    +2565  *   reqauth: true
    +2566  * }
    +2567  */
    +2568 KJUR.asn1.x509.AdobeTimeStamp = function(params) {
    +2569     KJUR.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this, params);
    +2570 
    +2571     var _KJUR = KJUR,
    +2572 	_KJUR_asn1 = _KJUR.asn1,
    +2573 	_DERInteger = _KJUR_asn1.DERInteger,
    +2574 	_DERBoolean = _KJUR_asn1.DERBoolean,
    +2575 	_DERSequence = _KJUR_asn1.DERSequence,
    +2576 	_GeneralName = _KJUR_asn1.x509.GeneralName;
    +2577 
    +2578     this.params = null;
    +2579 
    +2580     this.getExtnValueHex = function() {
    +2581 	var params = this.params;
    +2582 	var a = [new _DERInteger(1)];
    +2583 	a.push(new _GeneralName({uri: params.uri}));
    +2584 	if (params.reqauth != undefined) {
    +2585 	    a.push(new _DERBoolean(params.reqauth));
    +2586 	}
    +2587 
    +2588         this.asn1ExtnValue = new _DERSequence({array: a});
    +2589         return this.asn1ExtnValue.getEncodedHex();
    +2590     };
    +2591 
    +2592     this.oid = "1.2.840.113583.1.1.9.1";
    +2593     if (params !== undefined) this.setByParam(params);
    +2594 };
    +2595 YAHOO.lang.extend(KJUR.asn1.x509.AdobeTimeStamp, KJUR.asn1.x509.Extension);
    +2596  
    +2597 // === END   Other X.509v3 Extensions========================================
    +2598 
    +2599 
    +2600 // === BEGIN X500Name Related =================================================
    +2601 /**
    +2602  * X500Name ASN.1 structure class
    +2603  * @name KJUR.asn1.x509.X500Name
    +2604  * @class X500Name ASN.1 structure class
    +2605  * @param {Array} params associative array of parameters (ex. {'str': '/C=US/O=a'})
    +2606  * @extends KJUR.asn1.ASN1Object
    +2607  * @see KJUR.asn1.x509.X500Name
    +2608  * @see KJUR.asn1.x509.RDN
    +2609  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +2610  * @see X509#getX500Name
    +2611  * @description
    +2612  * This class provides DistinguishedName ASN.1 class structure
    +2613  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    +2614  * <blockquote><pre>
    +2615  * DistinguishedName ::= RDNSequence
    +2616  * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    +2617  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    +2618  *   AttributeTypeAndValue
    +2619  * AttributeTypeAndValue ::= SEQUENCE {
    +2620  *   type  AttributeType,
    +2621  *   value AttributeValue }
    +2622  * </pre></blockquote>
    +2623  * <br/>
    +2624  * Argument for the constructor can be one of following parameters:
    +2625  * <ul>
    +2626  * <li>{Array}array - array of {@link KJUR.asn1.x509.RDN} parameter</li>
    +2627  * <li>`String}str - string for distingish name in OpenSSL One line foramt (ex: /C=US/O=test/CN=test) See <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">this</a> in detail.</li>
    +2628  * <li>{String}ldapstr - string for distinguish name in LDAP format (ex: CN=test,O=test,C=US)</li>
    +2629  * <li>{String}hex - hexadecimal string for ASN.1 distinguish name structure</li>
    +2630  * <li>{String}certissuer - issuer name in the specified PEM certificate</li>
    +2631  * <li>{String}certsubject - subject name in the specified PEM certificate</li>
    +2632  * <li>{String}rule - DirectoryString rule (ex. "prn" or "utf8")</li>
    +2633  * </ul>
    +2634  * <br/>
    +2635  * NOTE1: The "array" and "rule" parameters have been supported
    +2636  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    +2637  * <br/>
    +2638  * NOTE2: Multi-valued RDN in "str" parameter have been
    +2639  * supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    +2640  * @example
    +2641  * // 1. construct with array
    +2642  * new KJUR.asn1.x509.X500Name({array:[
    +2643  *   [{type:'C',value:'JP',ds:'prn'}],
    +2644  *   [{type:'O',value:'aaa',ds:'utf8'}, // multi-valued RDN
    +2645  *    {type:'CN',value:'bob@example.com',ds:'ia5'}]
    +2646  * ]})
    +2647 : "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    +2648  * // 2. construct with string
    +2649  * new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    +2650  * // 3. construct by LDAP string
    +2651  * new KJUR.asn1.x509.X500Name({ldapstr: "CN=foo@example.com,OU=bbb,C=US"});
    +2652  * // 4. construct by ASN.1 hex string
    +2653  * new KJUR.asn1.x509.X500Name({hex: "304c3120..."});
    +2654  * // 5. construct by issuer of PEM certificate
    +2655  * new KJUR.asn1.x509.X500Name({certsubject: "-----BEGIN CERT..."});
    +2656  * // 6. construct by subject of PEM certificate
    +2657  * new KJUR.asn1.x509.X500Name({certissuer: "-----BEGIN CERT..."});
    +2658  * // 7. construct by object (DEPRECATED)
    +2659  * new KJUR.asn1.x509.X500Name({C:"US",O:"aaa",CN:"http://example.com/"});
    +2660  */
    +2661 KJUR.asn1.x509.X500Name = function(params) {
    +2662     KJUR.asn1.x509.X500Name.superclass.constructor.call(this);
    +2663     this.asn1Array = [];
    +2664     this.paramArray = [];
    +2665     this.sRule = "utf8";
    +2666     var _KJUR = KJUR,
    +2667 	_KJUR_asn1 = _KJUR.asn1,
    +2668 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +2669 	_RDN = _KJUR_asn1_x509.RDN,
    +2670 	_pemtohex = pemtohex;
    +2671 
    +2672     /**
    +2673      * set DN by OpenSSL oneline distinguished name string<br/>
    +2674      * @name setByString
    +2675      * @memberOf KJUR.asn1.x509.X500Name#
    +2676      * @function
    +2677      * @param {String} dnStr distinguished name by string (ex. /C=US/O=aaa)
    +2678      * @description
    +2679      * Sets distinguished name by string. 
    +2680      * dnStr must be formatted as 
    +2681      * "/type0=value0/type1=value1/type2=value2...".
    +2682      * No need to escape a slash in an attribute value.
    +2683      * @example
    +2684      * name = new KJUR.asn1.x509.X500Name();
    +2685      * name.setByString("/C=US/O=aaa/OU=bbb/CN=foo@example.com");
    +2686      * // no need to escape slash in an attribute value
    +2687      * name.setByString("/C=US/O=aaa/CN=1980/12/31");
    +2688      */
    +2689     this.setByString = function(dnStr, sRule) {
    +2690 	if (sRule !== undefined) this.sRule = sRule;
    +2691         var a = dnStr.split('/');
    +2692         a.shift();
    +2693 
    +2694 	var a1 = [];
    +2695 	for (var i = 0; i < a.length; i++) {
    +2696 	  if (a[i].match(/^[^=]+=.+$/)) {
    +2697 	    a1.push(a[i]);
    +2698 	  } else {
    +2699 	    var lastidx = a1.length - 1;
    +2700 	    a1[lastidx] = a1[lastidx] + "/" + a[i];
    +2701 	  }
    +2702 	}
    +2703 
    +2704         for (var i = 0; i < a1.length; i++) {
    +2705             this.asn1Array.push(new _RDN({'str':a1[i], rule:this.sRule}));
    +2706         }
    +2707     };
    +2708 
    +2709     /**
    +2710      * set DN by LDAP(RFC 2253) distinguished name string<br/>
    +2711      * @name setByLdapString
    +2712      * @memberOf KJUR.asn1.x509.X500Name#
    +2713      * @function
    +2714      * @param {String} dnStr distinguished name by LDAP string (ex. O=aaa,C=US)
    +2715      * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2716      * @see {@link KJUR.asn1.x509.X500Name.ldapToCompat}
    +2717      * @description
    +2718      * @example
    +2719      * name = new KJUR.asn1.x509.X500Name();
    +2720      * name.setByLdapString("CN=foo@example.com,OU=bbb,O=aaa,C=US");
    +2721      */
    +2722     this.setByLdapString = function(dnStr, sRule) {
    +2723 	if (sRule !== undefined) this.sRule = sRule;
    +2724 	var compat = _KJUR_asn1_x509.X500Name.ldapToCompat(dnStr);
    +2725 	this.setByString(compat, sRule);
    +2726     };
    +2727 
    +2728     /**
    +2729      * set DN by associative array<br/>
    +2730      * @name setByObject
    +2731      * @memberOf KJUR.asn1.x509.X500Name#
    +2732      * @function
    +2733      * @param {Array} dnObj associative array of DN (ex. {C: "US", O: "aaa"})
    +2734      * @since jsrsasign 4.9. asn1x509 1.0.13
    +2735      * @description
    +2736      * @example
    +2737      * name = new KJUR.asn1.x509.X500Name();
    +2738      * name.setByObject({C: "US", O: "aaa", CN="http://example.com/"1});
    +2739      */
    +2740     this.setByObject = function(dnObj, sRule) {
    +2741 	if (sRule !== undefined) this.sRule = sRule;
    +2742 
    +2743         // Get all the dnObject attributes and stuff them in the ASN.1 array.
    +2744         for (var x in dnObj) {
    +2745             if (dnObj.hasOwnProperty(x)) {
    +2746                 var newRDN = new _RDN({str: x + '=' + dnObj[x], rule: this.sRule});
    +2747                 // Initialize or push into the ANS1 array.
    +2748                 this.asn1Array ? this.asn1Array.push(newRDN)
    +2749                     : this.asn1Array = [newRDN];
    +2750             }
    +2751         }
    +2752     };
    +2753 
    +2754     this.setByParam = function(params) {
    +2755 	if (params.rule !== undefined) this.sRule = params.rule;
    +2756 
    +2757 	if (params.array !== undefined) {
    +2758 	    this.paramArray = params.array;
    +2759 	} else {
    +2760             if (params.str !== undefined) {
    +2761 		this.setByString(params.str);
    +2762             } else if (params.ldapstr !== undefined) {
    +2763 		this.setByLdapString(params.ldapstr);
    +2764 	    } else if (params.hex !== undefined) {
    +2765 		this.hTLV = params.hex;
    +2766             } else if (params.certissuer !== undefined) {
    +2767 		var x = new X509();
    +2768 		x.readCertPEM(params.certissuer);
    +2769 		this.hTLV = x.getIssuerHex();
    +2770             } else if (params.certsubject !== undefined) {
    +2771 		var x = new X509();
    +2772 		x.readCertPEM(params.certsubject);
    +2773 		this.hTLV = x.getSubjectHex();
    +2774 		// If params is an object, then set the ASN1 array
    +2775 		// just using the object attributes. 
    +2776 		// This is nice for fields that have lots of special
    +2777 		// characters (i.e. CN: 'https://www.github.com/kjur//').
    +2778             } else if (typeof params === "object" &&
    +2779 		       params.certsubject === undefined &&
    +2780 		       params.certissuer === undefined) {
    +2781 		this.setByObject(params);
    +2782             }
    +2783 	}
    +2784     }
    +2785 
    +2786     this.getEncodedHex = function() {
    +2787         if (typeof this.hTLV == "string") return this.hTLV;
    +2788 
    +2789 	if (this.asn1Array.length == 0 && this.paramArray.length > 0) {
    +2790 	    for (var i = 0; i < this.paramArray.length; i++) {
    +2791 		var param = {array: this.paramArray[i]};
    +2792 		if (this.sRule != "utf8") param.rule = this.sRule;
    +2793 		var asn1RDN = new _RDN(param);
    +2794 		this.asn1Array.push(asn1RDN);
    +2795 	    }
    +2796 	}
    +2797 
    +2798         var o = new _KJUR_asn1.DERSequence({"array": this.asn1Array});
    +2799         this.hTLV = o.getEncodedHex();
    +2800         return this.hTLV;
    +2801     };
    +2802 
    +2803     if (params !== undefined) this.setByParam(params);
    +2804 };
    +2805 YAHOO.lang.extend(KJUR.asn1.x509.X500Name, KJUR.asn1.ASN1Object);
    +2806 
    +2807 /**
    +2808  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format<br/>
    +2809  * @name compatToLDAP
    +2810  * @memberOf KJUR.asn1.x509.X500Name
    +2811  * @function
    +2812  * @param {String} s distinguished name string in OpenSSL oneline compat (ex. /C=US/O=test)
    +2813  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2814  * @since jsrsasign 8.0.19 asn1x509 1.1.20
    +2815  * @description
    +2816  * This static method converts a distinguished name string in OpenSSL compat
    +2817  * format to LDAP(RFC 2253) format.
    +2818  * @see <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">jsrsasign wiki: distinguished name string difference between OpenSSL compat and LDAP(RFC 2253)</a>
    +2819  * @see <a href="https://www.openssl.org/docs/man1.0.2/man1/openssl-x509.html#NAME-OPTIONS">OpenSSL x509 command manual - NAME OPTIONS</a>
    +2820  * @example
    +2821  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=test") → 'O=test,C=US'
    +2822  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=a,a") → 'O=a\,a,C=US'
    +2823  */
    +2824 KJUR.asn1.x509.X500Name.compatToLDAP = function(s) {
    +2825     if (s.substr(0, 1) !== "/") throw "malformed input";
    +2826 
    +2827     var result = "";
    +2828     s = s.substr(1);
    +2829 
    +2830     var a = s.split("/");
    +2831     a.reverse();
    +2832     a = a.map(function(s) {return s.replace(/,/, "\\,")});
    +2833 
    +2834     return a.join(",");
    +2835 };
    +2836 
    +2837 /**
    +2838  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format (DEPRECATED)<br/>
    +2839  * @name onelineToLDAP
    +2840  * @memberOf KJUR.asn1.x509.X500Name
    +2841  * @function
    +2842  * @param {String} s distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2843  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2844  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2845  * @see KJUR.asn1.x509.X500Name.compatToLDAP
    +2846  * @description
    +2847  * This method is deprecated. Please use 
    +2848  * {@link KJUR.asn1.x509.X500Name.compatToLDAP} instead.
    +2849  */
    +2850 KJUR.asn1.x509.X500Name.onelineToLDAP = function(s) {
    +2851     return KJUR.asn1.x509.X500Name.compatToLDAP(s);
    +2852 }
    +2853 
    +2854 /**
    +2855  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format<br/>
    +2856  * @name ldapToCompat
    +2857  * @memberOf KJUR.asn1.x509.X500Name
    +2858  * @function
    +2859  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2860  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2861  * @since jsrsasign 8.0.19 asn1x509 1.1.10
    +2862  * @description
    +2863  * This static method converts a distinguished name string in 
    +2864  * LDAP(RFC 2253) format to OpenSSL compat format.
    +2865  * @see <a href="https://github.com/kjur/jsrsasign/wiki/NOTE-distinguished-name-representation-in-jsrsasign">jsrsasign wiki: distinguished name string difference between OpenSSL compat and LDAP(RFC 2253)</a>
    +2866  * @example
    +2867  * KJUR.asn1.x509.X500Name.ldapToCompat('O=test,C=US') → '/C=US/O=test'
    +2868  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a\,a,C=US') → '/C=US/O=a,a'
    +2869  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a/a,C=US')  → '/C=US/O=a\/a'
    +2870  */
    +2871 KJUR.asn1.x509.X500Name.ldapToCompat = function(s) {
    +2872     var a = s.split(",");
    +2873 
    +2874     // join \,
    +2875     var isBSbefore = false;
    +2876     var a2 = [];
    +2877     for (var i = 0; a.length > 0; i++) {
    +2878 	var item = a.shift();
    +2879 	//console.log("item=" + item);
    +2880 
    +2881 	if (isBSbefore === true) {
    +2882 	    var a2last = a2.pop();
    +2883 	    var newitem = (a2last + "," + item).replace(/\\,/g, ",");
    +2884 	    a2.push(newitem);
    +2885 	    isBSbefore = false;
    +2886 	} else {
    +2887 	    a2.push(item);
    +2888 	}
    +2889 
    +2890 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    +2891     }
    +2892 
    +2893     a2 = a2.map(function(s) {return s.replace("/", "\\/")});
    +2894     a2.reverse();
    +2895     return "/" + a2.join("/");
    +2896 };
    +2897 
    +2898 /**
    +2899  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format (DEPRECATED)<br/>
    +2900  * @name ldapToOneline
    +2901  * @memberOf KJUR.asn1.x509.X500Name
    +2902  * @function
    +2903  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2904  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2905  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2906  * @description
    +2907  * This method is deprecated. Please use 
    +2908  * {@link KJUR.asn1.x509.X500Name.ldapToCompat} instead.
    +2909  */
    +2910 KJUR.asn1.x509.X500Name.ldapToOneline = function(s) {
    +2911     return KJUR.asn1.x509.X500Name.ldapToCompat(s);
    +2912 };
     2913 
    -2914     /**
    -2915      * add one AttributeTypeAndValue by multi-valued string<br/>
    -2916      * @name addByMultiValuedString
    -2917      * @memberOf KJUR.asn1.x509.RDN#
    -2918      * @function
    -2919      * @param {String} s string of multi-valued RDN
    -2920      * @return {Object} unspecified
    -2921      * @since jsrsasign 6.2.1 asn1x509 1.0.17
    -2922      * @description
    -2923      * This method add multi-valued RDN to RDN object.
    -2924      * @example
    -2925      * rdn = new KJUR.asn1.x509.RDN();
    -2926      * rdn.addByMultiValuedString("CN=john+O=test");
    -2927      * rdn.addByMultiValuedString("O=a+O=b\+b\+b+O=c"); // multi-valued RDN with quoted plus
    -2928      * rdn.addByMultiValuedString("O=a+O=\"b+b+b\"+O=c"); // multi-valued RDN with quoted quotation
    -2929      */
    -2930     this.addByMultiValuedString = function(s) {
    -2931 	var a = KJUR.asn1.x509.RDN.parseString(s);
    -2932 	for (var i = 0; i < a.length; i++) {
    -2933 	    this.addByString(a[i]);
    -2934 	}
    -2935     };
    -2936 
    -2937     this.getEncodedHex = function() {
    -2938 	if (this.asn1Array.length == 0 && this.paramArray.length > 0) {
    -2939 	    for (var i = 0; i < this.paramArray.length; i++) {
    -2940 		var param = this.paramArray[i];
    -2941 		if (param.rule !== undefined &&
    -2942 		    this.sRule != "utf8") {
    -2943 		    param.rule = this.sRule;
    -2944 		}
    -2945 		//alert(JSON.stringify(param));
    -2946 		var asn1ATV = new _AttributeTypeAndValue(param);
    -2947 		this.asn1Array.push(asn1ATV);
    -2948 	    }
    -2949 	}
    -2950         var o = new KJUR.asn1.DERSet({"array": this.asn1Array});
    -2951         this.TLV = o.getEncodedHex();
    -2952         return this.TLV;
    -2953     };
    -2954 
    -2955     if (params !== undefined) {
    -2956 	this.setByParam(params);
    -2957     }
    -2958 };
    -2959 YAHOO.lang.extend(KJUR.asn1.x509.RDN, KJUR.asn1.ASN1Object);
    -2960 
    -2961 /**
    -2962  * parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'<br/>
    -2963  * @name parseString
    -2964  * @memberOf KJUR.asn1.x509.RDN
    -2965  * @function
    -2966  * @param {String} s multi-valued string of RDN
    -2967  * @return {Array} array of string of AttributeTypeAndValue
    -2968  * @since jsrsasign 6.2.1 asn1x509 1.0.17
    -2969  * @description
    -2970  * This static method parses multi-valued RDN string and split into
    -2971  * array of AttributeTypeAndValue.
    -2972  * @example
    -2973  * KJUR.asn1.x509.RDN.parseString("CN=john") → ["CN=john"]
    -2974  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test") → ["CN=john", "OU=test"]
    -2975  * KJUR.asn1.x509.RDN.parseString('CN="jo+hn"+OU=test') → ["CN=jo+hn", "OU=test"]
    -2976  * KJUR.asn1.x509.RDN.parseString('CN=jo\+hn+OU=test') → ["CN=jo+hn", "OU=test"]
    -2977  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test+OU=t1") → ["CN=john", "OU=test", "OU=t1"]
    -2978  */
    -2979 KJUR.asn1.x509.RDN.parseString = function(s) {
    -2980     var a = s.split(/\+/);
    -2981 
    -2982     // join \+
    -2983     var isBSbefore = false;
    -2984     var a2 = [];
    -2985     for (var i = 0; a.length > 0; i++) {
    -2986 	var item = a.shift();
    -2987 	//console.log("item=" + item);
    -2988 
    -2989 	if (isBSbefore === true) {
    -2990 	    var a2last = a2.pop();
    -2991 	    var newitem = (a2last + "+" + item).replace(/\\\+/g, "+");
    -2992 	    a2.push(newitem);
    -2993 	    isBSbefore = false;
    -2994 	} else {
    -2995 	    a2.push(item);
    -2996 	}
    -2997 
    -2998 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    -2999     }
    -3000 
    -3001     // join quote
    -3002     var beginQuote = false;
    -3003     var a3 = [];
    -3004     for (var i = 0; a2.length > 0; i++) {
    -3005 	var item = a2.shift();
    -3006 
    -3007 	if (beginQuote === true) {
    -3008 	    var a3last = a3.pop();
    -3009 	    if (item.match(/"$/)) {
    -3010 		var newitem = (a3last + "+" + item).replace(/^([^=]+)="(.*)"$/, "$1=$2");
    -3011 		a3.push(newitem);
    -3012 		beginQuote = false;
    -3013 	    } else {
    -3014 		a3.push(a3last + "+" + item);
    -3015 	    }
    -3016 	} else {
    -3017 	    a3.push(item);
    +2914 /**
    +2915  * RDN (Relative Distinguished Name) ASN.1 structure class
    +2916  * @name KJUR.asn1.x509.RDN
    +2917  * @class RDN (Relative Distinguished Name) ASN.1 structure class
    +2918  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    +2919  * @extends KJUR.asn1.ASN1Object
    +2920  * @see KJUR.asn1.x509.X500Name
    +2921  * @see KJUR.asn1.x509.RDN
    +2922  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +2923  * @description
    +2924  * This class provides RelativeDistinguishedName ASN.1 class structure
    +2925  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    +2926  * <blockquote><pre>
    +2927  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    +2928  *   AttributeTypeAndValue
    +2929  *
    +2930  * AttributeTypeAndValue ::= SEQUENCE {
    +2931  *   type  AttributeType,
    +2932  *   value AttributeValue }
    +2933  * </pre></blockquote>
    +2934  * <br/>
    +2935  * NOTE1: The "array" and "rule" parameters have been supported
    +2936  * since jsrsasign 9.0.0 asn1x509 2.0.0.
    +2937  * <br/>
    +2938  * NOTE2: Multi-valued RDN in "str" parameter have been
    +2939  * supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    +2940  * @example
    +2941  * new KJUR.asn1.x509.RDN({array: [ // multi-valued
    +2942  *    {type:"CN",value:"Bob",ds:"prn"},
    +2943  *    {type:"CN",value:"bob@example.com", ds:"ia5"}
    +2944  * ]});
    +2945  * new KJUR.asn1.x509.RDN({str: "CN=test"});
    +2946  * new KJUR.asn1.x509.RDN({str: "O=a+O=bb+O=c"}); // multi-valued
    +2947  * new KJUR.asn1.x509.RDN({str: "O=a+O=b\\+b+O=c"}); // plus escaped
    +2948  * new KJUR.asn1.x509.RDN({str: "O=a+O=\"b+b\"+O=c"}); // double quoted
    +2949  */
    +2950 KJUR.asn1.x509.RDN = function(params) {
    +2951     KJUR.asn1.x509.RDN.superclass.constructor.call(this);
    +2952     this.asn1Array = [];
    +2953     this.paramArray = [];
    +2954     this.sRule = "utf8"; // DEFAULT "utf8"
    +2955     var _AttributeTypeAndValue = KJUR.asn1.x509.AttributeTypeAndValue;
    +2956 
    +2957     this.setByParam = function(params) {
    +2958 	if (params.rule !== undefined) this.sRule = params.rule;
    +2959         if (params.str !== undefined) {
    +2960             this.addByMultiValuedString(params.str);
    +2961         }
    +2962 	if (params.array !== undefined) this.paramArray = params.array;
    +2963     };
    +2964 
    +2965     /**
    +2966      * add one AttributeTypeAndValue by string<br/>
    +2967      * @name addByString
    +2968      * @memberOf KJUR.asn1.x509.RDN#
    +2969      * @function
    +2970      * @param {String} s string of AttributeTypeAndValue
    +2971      * @return {Object} unspecified
    +2972      * @description
    +2973      * This method add one AttributeTypeAndValue to RDN object.
    +2974      * @example
    +2975      * rdn = new KJUR.asn1.x509.RDN();
    +2976      * rdn.addByString("CN=john");
    +2977      * rdn.addByString("serialNumber=1234"); // for multi-valued RDN
    +2978      */
    +2979     this.addByString = function(s) {
    +2980         this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({'str': s, rule: this.sRule}));
    +2981     };
    +2982 
    +2983     /**
    +2984      * add one AttributeTypeAndValue by multi-valued string<br/>
    +2985      * @name addByMultiValuedString
    +2986      * @memberOf KJUR.asn1.x509.RDN#
    +2987      * @function
    +2988      * @param {String} s string of multi-valued RDN
    +2989      * @return {Object} unspecified
    +2990      * @since jsrsasign 6.2.1 asn1x509 1.0.17
    +2991      * @description
    +2992      * This method add multi-valued RDN to RDN object.
    +2993      * @example
    +2994      * rdn = new KJUR.asn1.x509.RDN();
    +2995      * rdn.addByMultiValuedString("CN=john+O=test");
    +2996      * rdn.addByMultiValuedString("O=a+O=b\+b\+b+O=c"); // multi-valued RDN with quoted plus
    +2997      * rdn.addByMultiValuedString("O=a+O=\"b+b+b\"+O=c"); // multi-valued RDN with quoted quotation
    +2998      */
    +2999     this.addByMultiValuedString = function(s) {
    +3000 	var a = KJUR.asn1.x509.RDN.parseString(s);
    +3001 	for (var i = 0; i < a.length; i++) {
    +3002 	    this.addByString(a[i]);
    +3003 	}
    +3004     };
    +3005 
    +3006     this.getEncodedHex = function() {
    +3007 	if (this.asn1Array.length == 0 && this.paramArray.length > 0) {
    +3008 	    for (var i = 0; i < this.paramArray.length; i++) {
    +3009 		var param = this.paramArray[i];
    +3010 		if (param.rule !== undefined &&
    +3011 		    this.sRule != "utf8") {
    +3012 		    param.rule = this.sRule;
    +3013 		}
    +3014 		//alert(JSON.stringify(param));
    +3015 		var asn1ATV = new _AttributeTypeAndValue(param);
    +3016 		this.asn1Array.push(asn1ATV);
    +3017 	    }
     3018 	}
    -3019 
    -3020 	if (item.match(/^[^=]+="/)) {
    -3021 	    //console.log(i + "=" + item);
    -3022 	    beginQuote = true;
    -3023 	}
    -3024     }
    -3025     return a3;
    -3026 };
    -3027 
    -3028 /**
    -3029  * AttributeTypeAndValue ASN.1 structure class
    -3030  * @name KJUR.asn1.x509.AttributeTypeAndValue
    -3031  * @class AttributeTypeAndValue ASN.1 structure class
    -3032  * @param {Array} params JSON object for parameters (ex. {str: 'C=US'})
    -3033  * @extends KJUR.asn1.ASN1Object
    -3034  * @see KJUR.asn1.x509.X500Name
    -3035  * @see KJUR.asn1.x509.RDN
    -3036  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -3037  * @see X509#getAttrTypeAndValue
    +3019         var o = new KJUR.asn1.DERSet({"array": this.asn1Array});
    +3020         this.TLV = o.getEncodedHex();
    +3021         return this.TLV;
    +3022     };
    +3023 
    +3024     if (params !== undefined) {
    +3025 	this.setByParam(params);
    +3026     }
    +3027 };
    +3028 YAHOO.lang.extend(KJUR.asn1.x509.RDN, KJUR.asn1.ASN1Object);
    +3029 
    +3030 /**
    +3031  * parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'<br/>
    +3032  * @name parseString
    +3033  * @memberOf KJUR.asn1.x509.RDN
    +3034  * @function
    +3035  * @param {String} s multi-valued string of RDN
    +3036  * @return {Array} array of string of AttributeTypeAndValue
    +3037  * @since jsrsasign 6.2.1 asn1x509 1.0.17
     3038  * @description
    -3039  * This class generates AttributeTypeAndValue defined in
    -3040  * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    -3041  * RFC 5280 4.1.2.4</a>.
    -3042  * <pre>
    -3043  * AttributeTypeAndValue ::= SEQUENCE {
    -3044  *   type     AttributeType,
    -3045  *   value    AttributeValue }
    -3046  * AttributeType ::= OBJECT IDENTIFIER
    -3047  * AttributeValue ::= ANY -- DEFINED BY AttributeType
    -3048  * </pre>
    -3049  * The constructor argument can have following parameters:
    -3050  * <ul>
    -3051  * <li>{String}type - AttributeType name or OID(ex. C,O,CN)</li>
    -3052  * <li>{String}value - raw string of ASN.1 value of AttributeValue</li>
    -3053  * <li>{String}ds - DirectoryString type of AttributeValue</li>
    -3054  * <li>{String}rule - DirectoryString type rule (ex. "prn" or "utf8")
    -3055  * set DirectoryString type automatically when "ds" not specified.</li>
    -3056  * <li>{String}str - AttributeTypeAndVale string (ex. "C=US").
    -3057  * When type and value don't exists, 
    -3058  * this "str" will be converted to "type" and "value".
    -3059  * </li>
    -3060  * </ul>
    -3061  * <br
    -3062  * NOTE: Parameters "type", "value,", "ds" and "rule" have
    -3063  * been supported since jsrsasign 9.0.0 asn1x509 2.0.0.
    -3064  * @example
    -3065  * new KJUR.asn1.x509.AttributeTypeAndValue({type:'C',value:'US',ds:'prn'})
    -3066  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1'})
    -3067  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1',rule='prn'})
    -3068  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1',rule='utf8'})
    -3069  */
    -3070 KJUR.asn1.x509.AttributeTypeAndValue = function(params) {
    -3071     KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);
    -3072     this.sRule = "utf8";
    -3073     this.sType = null;
    -3074     this.sValue = null;
    -3075     this.dsType = null;
    -3076     var _KJUR = KJUR,
    -3077 	_KJUR_asn1 = _KJUR.asn1,
    -3078 	_DERSequence = _KJUR_asn1.DERSequence,
    -3079 	_DERUTF8String = _KJUR_asn1.DERUTF8String,
    -3080 	_DERPrintableString = _KJUR_asn1.DERPrintableString,
    -3081 	_DERTeletexString = _KJUR_asn1.DERTeletexString,
    -3082 	_DERIA5String = _KJUR_asn1.DERIA5String,
    -3083 	_DERVisibleString = _KJUR_asn1.DERVisibleString,
    -3084 	_DERBMPString = _KJUR_asn1.DERBMPString,
    -3085 	_isMail = _KJUR.lang.String.isMail,
    -3086 	_isPrintable = _KJUR.lang.String.isPrintable;
    -3087 
    -3088     this.setByParam = function(params) {
    -3089 	if (params.rule !== undefined) this.sRule = params.rule;
    -3090 	if (params.ds !== undefined)   this.dsType = params.ds;
    -3091 
    -3092         if (params.value === undefined &&
    -3093 	    params.str !== undefined) {
    -3094 	    var str = params.str;
    -3095             var matchResult = str.match(/^([^=]+)=(.+)$/);
    -3096             if (matchResult) {
    -3097 		this.sType = matchResult[1];
    -3098 		this.sValue = matchResult[2];
    -3099             } else {
    -3100 		throw new Error("malformed attrTypeAndValueStr: " +
    -3101 				attrTypeAndValueStr);
    -3102             }
    -3103 	    
    -3104 	    //this.setByString(params.str);
    -3105         } else {
    -3106 	    this.sType = params.type;
    -3107 	    this.sValue = params.value;
    -3108 	}
    -3109     };
    -3110 
    -3111     /*
    -3112      * @deprecated
    -3113      */
    -3114     this.setByString = function(sTypeValue, sRule) {
    -3115 	if (sRule !== undefined) this.sRule = sRule;
    -3116         var matchResult = sTypeValue.match(/^([^=]+)=(.+)$/);
    -3117         if (matchResult) {
    -3118             this.setByAttrTypeAndValueStr(matchResult[1], matchResult[2]);
    -3119         } else {
    -3120             throw new Error("malformed attrTypeAndValueStr: " +
    -3121 			    attrTypeAndValueStr);
    -3122         }
    -3123     };
    -3124 
    -3125     this._getDsType = function() {
    -3126 	var sType = this.sType;
    -3127 	var sValue = this.sValue;
    -3128 	var sRule = this.sRule;
    -3129 
    -3130 	if (sRule === "prn") {
    -3131 	    if (sType == "CN" && _isMail(sValue)) return "ia5";
    -3132 	    if (_isPrintable(sValue)) return "prn";
    -3133 	    return "utf8";
    -3134 	} else if (sRule === "utf8") {
    -3135 	    if (sType == "CN" && _isMail(sValue)) return "ia5";
    -3136 	    if (sType == "C") return "prn";
    -3137 	    return "utf8";
    -3138 	}
    -3139 	return "utf8"; // default
    -3140     };
    -3141 
    -3142     this.setByAttrTypeAndValueStr = function(sType, sValue, sRule) {
    -3143 	if (sRule !== undefined) this.sRule = sRule;
    -3144 	this.sType = sType;
    -3145 	this.sValue = sValue;
    -3146     };
    -3147 
    -3148     this.getValueObj = function(dsType, valueStr) {
    -3149         if (dsType == "utf8") return new _DERUTF8String({"str": valueStr});
    -3150         if (dsType == "prn")  return new _DERPrintableString({"str": valueStr});
    -3151         if (dsType == "tel")  return new _DERTeletexString({"str": valueStr});
    -3152         if (dsType == "ia5")  return new _DERIA5String({"str": valueStr});
    -3153         if (dsType == "vis")  return new _DERVisibleString({"str": valueStr});
    -3154         if (dsType == "bmp")  return new _DERBMPString({"str": valueStr});
    -3155         throw new Error("unsupported directory string type: type=" +
    -3156 			dsType + " value=" + valueStr);
    -3157     };
    -3158 
    -3159     this.getEncodedHex = function() {
    -3160 	if (this.dsType == null) this.dsType = this._getDsType();
    -3161 	var asn1Type = KJUR.asn1.x509.OID.atype2obj(this.sType);
    -3162 	var asn1Value = this.getValueObj(this.dsType, this.sValue);
    -3163         var o = new _DERSequence({"array": [asn1Type, asn1Value]});
    -3164         this.TLV = o.getEncodedHex();
    -3165         return this.TLV;
    -3166     };
    -3167 
    -3168     if (params !== undefined) {
    -3169 	this.setByParam(params);
    -3170     }
    -3171 };
    -3172 YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue, KJUR.asn1.ASN1Object);
    -3173 
    -3174 // === END   X500Name Related =================================================
    -3175 
    -3176 // === BEGIN Other ASN1 structure class  ======================================
    -3177 
    -3178 /**
    -3179  * SubjectPublicKeyInfo ASN.1 structure class
    -3180  * @name KJUR.asn1.x509.SubjectPublicKeyInfo
    -3181  * @class SubjectPublicKeyInfo ASN.1 structure class
    -3182  * @param {Object} params parameter for subject public key
    -3183  * @extends KJUR.asn1.ASN1Object
    -3184  * @description
    -3185  * <br/>
    -3186  * As for argument 'params' for constructor, you can specify one of
    -3187  * following properties:
    -3188  * <ul>
    -3189  * <li>{@link RSAKey} object</li>
    -3190  * <li>{@link KJUR.crypto.ECDSA} object</li>
    -3191  * <li>{@link KJUR.crypto.DSA} object</li>
    -3192  * </ul>
    -3193  * NOTE1: 'params' can be omitted.<br/>
    -3194  * NOTE2: DSA/ECDSA key object is also supported since asn1x509 1.0.6.<br/>
    -3195  * <h4>EXAMPLE</h4>
    -3196  * @example
    -3197  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(RSAKey_object);
    -3198  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoECDSA_object);
    -3199  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoDSA_object);
    -3200  */
    -3201 KJUR.asn1.x509.SubjectPublicKeyInfo = function(params) {
    -3202     KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);
    -3203     var asn1AlgId = null,
    -3204 	asn1SubjPKey = null,
    -3205 	_KJUR = KJUR,
    -3206 	_KJUR_asn1 = _KJUR.asn1,
    -3207 	_DERInteger = _KJUR_asn1.DERInteger,
    -3208 	_DERBitString = _KJUR_asn1.DERBitString,
    -3209 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -3210 	_DERSequence = _KJUR_asn1.DERSequence,
    -3211 	_newObject = _KJUR_asn1.ASN1Util.newObject,
    -3212 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -3213 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    -3214 	_KJUR_crypto = _KJUR.crypto,
    -3215 	_KJUR_crypto_ECDSA = _KJUR_crypto.ECDSA,
    -3216 	_KJUR_crypto_DSA = _KJUR_crypto.DSA;
    -3217 
    -3218     /*
    -3219      * @since asn1x509 1.0.7
    -3220      */
    -3221     this.getASN1Object = function() {
    -3222         if (this.asn1AlgId == null || this.asn1SubjPKey == null)
    -3223             throw "algId and/or subjPubKey not set";
    -3224         var o = new _DERSequence({'array':
    -3225                                   [this.asn1AlgId, this.asn1SubjPKey]});
    -3226         return o;
    -3227     };
    -3228 
    -3229     this.getEncodedHex = function() {
    -3230         var o = this.getASN1Object();
    -3231         this.hTLV = o.getEncodedHex();
    -3232         return this.hTLV;
    -3233     };
    -3234 
    -3235     /**
    -3236      * @name setPubKey
    -3237      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo#
    -3238      * @function
    -3239      * @param {Object} {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object
    -3240      * @since jsrsasign 8.0.0 asn1x509 1.1.0
    -3241      * @description
    -3242      * @example
    -3243      * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo();
    -3244      * pubKey = KEYUTIL.getKey(PKCS8PUBKEYPEM);
    -3245      * spki.setPubKey(pubKey);
    -3246      */
    -3247     this.setPubKey = function(key) {
    -3248 	try {
    -3249 	    if (key instanceof RSAKey) {
    -3250 		var asn1RsaPub = _newObject({
    -3251 		    'seq': [{'int': {'bigint': key.n}}, {'int': {'int': key.e}}]
    -3252 		});
    -3253 		var rsaKeyHex = asn1RsaPub.getEncodedHex();
    -3254 		this.asn1AlgId = new _AlgorithmIdentifier({'name':'rsaEncryption'});
    -3255 		this.asn1SubjPKey = new _DERBitString({'hex':'00'+rsaKeyHex});
    -3256 	    }
    -3257 	} catch(ex) {};
    -3258 
    -3259 	try {
    -3260 	    if (key instanceof KJUR.crypto.ECDSA) {
    -3261 		var asn1Params = new _DERObjectIdentifier({'name': key.curveName});
    -3262 		this.asn1AlgId =
    -3263 		    new _AlgorithmIdentifier({'name': 'ecPublicKey',
    -3264 					      'asn1params': asn1Params});
    -3265 		this.asn1SubjPKey = new _DERBitString({'hex': '00' + key.pubKeyHex});
    -3266 	    }
    -3267 	} catch(ex) {};
    -3268 
    -3269 	try {
    -3270 	    if (key instanceof KJUR.crypto.DSA) {
    -3271 		var asn1Params = new _newObject({
    -3272 		    'seq': [{'int': {'bigint': key.p}},
    -3273 			    {'int': {'bigint': key.q}},
    -3274 			    {'int': {'bigint': key.g}}]
    -3275 		});
    -3276 		this.asn1AlgId =
    -3277 		    new _AlgorithmIdentifier({'name': 'dsa',
    -3278 					      'asn1params': asn1Params});
    -3279 		var pubInt = new _DERInteger({'bigint': key.y});
    -3280 		this.asn1SubjPKey = 
    -3281 		    new _DERBitString({'hex': '00' + pubInt.getEncodedHex()});
    -3282 	    }
    -3283 	} catch(ex) {};
    -3284     };
    -3285 
    -3286     if (params !== undefined) {
    -3287 	this.setPubKey(params);
    -3288     }
    -3289 };
    -3290 YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo, KJUR.asn1.ASN1Object);
    -3291 
    -3292 /**
    -3293  * Time ASN.1 structure class<br/>
    -3294  * @name KJUR.asn1.x509.Time
    -3295  * @class Time ASN.1 structure class
    -3296  * @param {Array} params associative array of parameters (ex. {'str': '130508235959Z'})
    -3297  * @extends KJUR.asn1.ASN1Object
    -3298  * @see KJUR.asn1.DERUTCTime
    -3299  * @see KJUR.asn1.DERGeneralizedTime
    -3300  * @description
    -3301  * This class represents Time ASN.1 structure defined in 
    -3302  * <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>
    -3303  * <pre>
    -3304  * Time ::= CHOICE {
    -3305  *      utcTime        UTCTime,
    -3306  *      generalTime    GeneralizedTime }
    -3307  * </pre>
    -3308  *
    -3309  * @example
    -3310  * var t1 = new KJUR.asn1.x509.Time{'str': '130508235959Z'} // UTCTime by default
    -3311  * var t2 = new KJUR.asn1.x509.Time{'type': 'gen',  'str': '20130508235959Z'} // GeneralizedTime
    -3312  */
    -3313 KJUR.asn1.x509.Time = function(params) {
    -3314     KJUR.asn1.x509.Time.superclass.constructor.call(this);
    -3315     var type = null,
    -3316 	timeParams = null,
    -3317 	_KJUR = KJUR,
    -3318 	_KJUR_asn1 = _KJUR.asn1,
    -3319 	_DERUTCTime = _KJUR_asn1.DERUTCTime,
    -3320 	_DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime;
    -3321 
    -3322     this.setTimeParams = function(timeParams) {
    -3323         this.timeParams = timeParams;
    -3324     }
    -3325 
    -3326     this.getEncodedHex = function() {
    -3327         var o = null;
    -3328 
    -3329         if (this.timeParams != null) {
    -3330             if (this.type == "utc") {
    -3331                 o = new _DERUTCTime(this.timeParams);
    -3332             } else {
    -3333                 o = new _DERGeneralizedTime(this.timeParams);
    -3334             }
    -3335         } else {
    -3336             if (this.type == "utc") {
    -3337                 o = new _DERUTCTime();
    -3338             } else {
    -3339                 o = new _DERGeneralizedTime();
    -3340             }
    -3341         }
    -3342         this.TLV = o.getEncodedHex();
    -3343         return this.TLV;
    -3344     };
    -3345 
    -3346     this.type = "utc";
    -3347     if (params !== undefined) {
    -3348         if (params.type !== undefined) {
    -3349             this.type = params.type;
    -3350         } else {
    -3351             if (params.str !== undefined) {
    -3352                 if (params.str.match(/^[0-9]{12}Z$/)) this.type = "utc";
    -3353                 if (params.str.match(/^[0-9]{14}Z$/)) this.type = "gen";
    -3354             }
    -3355         }
    -3356         this.timeParams = params;
    +3039  * This static method parses multi-valued RDN string and split into
    +3040  * array of AttributeTypeAndValue.
    +3041  * @example
    +3042  * KJUR.asn1.x509.RDN.parseString("CN=john") → ["CN=john"]
    +3043  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test") → ["CN=john", "OU=test"]
    +3044  * KJUR.asn1.x509.RDN.parseString('CN="jo+hn"+OU=test') → ["CN=jo+hn", "OU=test"]
    +3045  * KJUR.asn1.x509.RDN.parseString('CN=jo\+hn+OU=test') → ["CN=jo+hn", "OU=test"]
    +3046  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test+OU=t1") → ["CN=john", "OU=test", "OU=t1"]
    +3047  */
    +3048 KJUR.asn1.x509.RDN.parseString = function(s) {
    +3049     var a = s.split(/\+/);
    +3050 
    +3051     // join \+
    +3052     var isBSbefore = false;
    +3053     var a2 = [];
    +3054     for (var i = 0; a.length > 0; i++) {
    +3055 	var item = a.shift();
    +3056 	//console.log("item=" + item);
    +3057 
    +3058 	if (isBSbefore === true) {
    +3059 	    var a2last = a2.pop();
    +3060 	    var newitem = (a2last + "+" + item).replace(/\\\+/g, "+");
    +3061 	    a2.push(newitem);
    +3062 	    isBSbefore = false;
    +3063 	} else {
    +3064 	    a2.push(item);
    +3065 	}
    +3066 
    +3067 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    +3068     }
    +3069 
    +3070     // join quote
    +3071     var beginQuote = false;
    +3072     var a3 = [];
    +3073     for (var i = 0; a2.length > 0; i++) {
    +3074 	var item = a2.shift();
    +3075 
    +3076 	if (beginQuote === true) {
    +3077 	    var a3last = a3.pop();
    +3078 	    if (item.match(/"$/)) {
    +3079 		var newitem = (a3last + "+" + item).replace(/^([^=]+)="(.*)"$/, "$1=$2");
    +3080 		a3.push(newitem);
    +3081 		beginQuote = false;
    +3082 	    } else {
    +3083 		a3.push(a3last + "+" + item);
    +3084 	    }
    +3085 	} else {
    +3086 	    a3.push(item);
    +3087 	}
    +3088 
    +3089 	if (item.match(/^[^=]+="/)) {
    +3090 	    //console.log(i + "=" + item);
    +3091 	    beginQuote = true;
    +3092 	}
    +3093     }
    +3094     return a3;
    +3095 };
    +3096 
    +3097 /**
    +3098  * AttributeTypeAndValue ASN.1 structure class
    +3099  * @name KJUR.asn1.x509.AttributeTypeAndValue
    +3100  * @class AttributeTypeAndValue ASN.1 structure class
    +3101  * @param {Array} params JSON object for parameters (ex. {str: 'C=US'})
    +3102  * @extends KJUR.asn1.ASN1Object
    +3103  * @see KJUR.asn1.x509.X500Name
    +3104  * @see KJUR.asn1.x509.RDN
    +3105  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +3106  * @see X509#getAttrTypeAndValue
    +3107  * @description
    +3108  * This class generates AttributeTypeAndValue defined in
    +3109  * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    +3110  * RFC 5280 4.1.2.4</a>.
    +3111  * <pre>
    +3112  * AttributeTypeAndValue ::= SEQUENCE {
    +3113  *   type     AttributeType,
    +3114  *   value    AttributeValue }
    +3115  * AttributeType ::= OBJECT IDENTIFIER
    +3116  * AttributeValue ::= ANY -- DEFINED BY AttributeType
    +3117  * </pre>
    +3118  * The constructor argument can have following parameters:
    +3119  * <ul>
    +3120  * <li>{String}type - AttributeType name or OID(ex. C,O,CN)</li>
    +3121  * <li>{String}value - raw string of ASN.1 value of AttributeValue</li>
    +3122  * <li>{String}ds - DirectoryString type of AttributeValue</li>
    +3123  * <li>{String}rule - DirectoryString type rule (ex. "prn" or "utf8")
    +3124  * set DirectoryString type automatically when "ds" not specified.</li>
    +3125  * <li>{String}str - AttributeTypeAndVale string (ex. "C=US").
    +3126  * When type and value don't exists, 
    +3127  * this "str" will be converted to "type" and "value".
    +3128  * </li>
    +3129  * </ul>
    +3130  * <br
    +3131  * NOTE: Parameters "type", "value,", "ds" and "rule" have
    +3132  * been supported since jsrsasign 9.0.0 asn1x509 2.0.0.
    +3133  * @example
    +3134  * new KJUR.asn1.x509.AttributeTypeAndValue({type:'C',value:'US',ds:'prn'})
    +3135  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1'})
    +3136  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1',rule='prn'})
    +3137  * new KJUR.asn1.x509.AttributeTypeAndValue({str:'O=T1',rule='utf8'})
    +3138  */
    +3139 KJUR.asn1.x509.AttributeTypeAndValue = function(params) {
    +3140     KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);
    +3141     this.sRule = "utf8";
    +3142     this.sType = null;
    +3143     this.sValue = null;
    +3144     this.dsType = null;
    +3145     var _KJUR = KJUR,
    +3146 	_KJUR_asn1 = _KJUR.asn1,
    +3147 	_DERSequence = _KJUR_asn1.DERSequence,
    +3148 	_DERUTF8String = _KJUR_asn1.DERUTF8String,
    +3149 	_DERPrintableString = _KJUR_asn1.DERPrintableString,
    +3150 	_DERTeletexString = _KJUR_asn1.DERTeletexString,
    +3151 	_DERIA5String = _KJUR_asn1.DERIA5String,
    +3152 	_DERVisibleString = _KJUR_asn1.DERVisibleString,
    +3153 	_DERBMPString = _KJUR_asn1.DERBMPString,
    +3154 	_isMail = _KJUR.lang.String.isMail,
    +3155 	_isPrintable = _KJUR.lang.String.isPrintable;
    +3156 
    +3157     this.setByParam = function(params) {
    +3158 	if (params.rule !== undefined) this.sRule = params.rule;
    +3159 	if (params.ds !== undefined)   this.dsType = params.ds;
    +3160 
    +3161         if (params.value === undefined &&
    +3162 	    params.str !== undefined) {
    +3163 	    var str = params.str;
    +3164             var matchResult = str.match(/^([^=]+)=(.+)$/);
    +3165             if (matchResult) {
    +3166 		this.sType = matchResult[1];
    +3167 		this.sValue = matchResult[2];
    +3168             } else {
    +3169 		throw new Error("malformed attrTypeAndValueStr: " +
    +3170 				attrTypeAndValueStr);
    +3171             }
    +3172 	    
    +3173 	    //this.setByString(params.str);
    +3174         } else {
    +3175 	    this.sType = params.type;
    +3176 	    this.sValue = params.value;
    +3177 	}
    +3178     };
    +3179 
    +3180     /*
    +3181      * @deprecated
    +3182      */
    +3183     this.setByString = function(sTypeValue, sRule) {
    +3184 	if (sRule !== undefined) this.sRule = sRule;
    +3185         var matchResult = sTypeValue.match(/^([^=]+)=(.+)$/);
    +3186         if (matchResult) {
    +3187             this.setByAttrTypeAndValueStr(matchResult[1], matchResult[2]);
    +3188         } else {
    +3189             throw new Error("malformed attrTypeAndValueStr: " +
    +3190 			    attrTypeAndValueStr);
    +3191         }
    +3192     };
    +3193 
    +3194     this._getDsType = function() {
    +3195 	var sType = this.sType;
    +3196 	var sValue = this.sValue;
    +3197 	var sRule = this.sRule;
    +3198 
    +3199 	if (sRule === "prn") {
    +3200 	    if (sType == "CN" && _isMail(sValue)) return "ia5";
    +3201 	    if (_isPrintable(sValue)) return "prn";
    +3202 	    return "utf8";
    +3203 	} else if (sRule === "utf8") {
    +3204 	    if (sType == "CN" && _isMail(sValue)) return "ia5";
    +3205 	    if (sType == "C") return "prn";
    +3206 	    return "utf8";
    +3207 	}
    +3208 	return "utf8"; // default
    +3209     };
    +3210 
    +3211     this.setByAttrTypeAndValueStr = function(sType, sValue, sRule) {
    +3212 	if (sRule !== undefined) this.sRule = sRule;
    +3213 	this.sType = sType;
    +3214 	this.sValue = sValue;
    +3215     };
    +3216 
    +3217     this.getValueObj = function(dsType, valueStr) {
    +3218         if (dsType == "utf8") return new _DERUTF8String({"str": valueStr});
    +3219         if (dsType == "prn")  return new _DERPrintableString({"str": valueStr});
    +3220         if (dsType == "tel")  return new _DERTeletexString({"str": valueStr});
    +3221         if (dsType == "ia5")  return new _DERIA5String({"str": valueStr});
    +3222         if (dsType == "vis")  return new _DERVisibleString({"str": valueStr});
    +3223         if (dsType == "bmp")  return new _DERBMPString({"str": valueStr});
    +3224         throw new Error("unsupported directory string type: type=" +
    +3225 			dsType + " value=" + valueStr);
    +3226     };
    +3227 
    +3228     this.getEncodedHex = function() {
    +3229 	if (this.dsType == null) this.dsType = this._getDsType();
    +3230 	var asn1Type = KJUR.asn1.x509.OID.atype2obj(this.sType);
    +3231 	var asn1Value = this.getValueObj(this.dsType, this.sValue);
    +3232         var o = new _DERSequence({"array": [asn1Type, asn1Value]});
    +3233         this.TLV = o.getEncodedHex();
    +3234         return this.TLV;
    +3235     };
    +3236 
    +3237     if (params !== undefined) {
    +3238 	this.setByParam(params);
    +3239     }
    +3240 };
    +3241 YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue, KJUR.asn1.ASN1Object);
    +3242 
    +3243 // === END   X500Name Related =================================================
    +3244 
    +3245 // === BEGIN Other ASN1 structure class  ======================================
    +3246 
    +3247 /**
    +3248  * SubjectPublicKeyInfo ASN.1 structure class
    +3249  * @name KJUR.asn1.x509.SubjectPublicKeyInfo
    +3250  * @class SubjectPublicKeyInfo ASN.1 structure class
    +3251  * @param {Object} params parameter for subject public key
    +3252  * @extends KJUR.asn1.ASN1Object
    +3253  * @description
    +3254  * <br/>
    +3255  * As for argument 'params' for constructor, you can specify one of
    +3256  * following properties:
    +3257  * <ul>
    +3258  * <li>{@link RSAKey} object</li>
    +3259  * <li>{@link KJUR.crypto.ECDSA} object</li>
    +3260  * <li>{@link KJUR.crypto.DSA} object</li>
    +3261  * </ul>
    +3262  * NOTE1: 'params' can be omitted.<br/>
    +3263  * NOTE2: DSA/ECDSA key object is also supported since asn1x509 1.0.6.<br/>
    +3264  * <h4>EXAMPLE</h4>
    +3265  * @example
    +3266  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(RSAKey_object);
    +3267  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoECDSA_object);
    +3268  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoDSA_object);
    +3269  */
    +3270 KJUR.asn1.x509.SubjectPublicKeyInfo = function(params) {
    +3271     KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);
    +3272     var asn1AlgId = null,
    +3273 	asn1SubjPKey = null,
    +3274 	_KJUR = KJUR,
    +3275 	_KJUR_asn1 = _KJUR.asn1,
    +3276 	_DERInteger = _KJUR_asn1.DERInteger,
    +3277 	_DERBitString = _KJUR_asn1.DERBitString,
    +3278 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +3279 	_DERSequence = _KJUR_asn1.DERSequence,
    +3280 	_newObject = _KJUR_asn1.ASN1Util.newObject,
    +3281 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +3282 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    +3283 	_KJUR_crypto = _KJUR.crypto,
    +3284 	_KJUR_crypto_ECDSA = _KJUR_crypto.ECDSA,
    +3285 	_KJUR_crypto_DSA = _KJUR_crypto.DSA;
    +3286 
    +3287     /*
    +3288      * @since asn1x509 1.0.7
    +3289      */
    +3290     this.getASN1Object = function() {
    +3291         if (this.asn1AlgId == null || this.asn1SubjPKey == null)
    +3292             throw "algId and/or subjPubKey not set";
    +3293         var o = new _DERSequence({'array':
    +3294                                   [this.asn1AlgId, this.asn1SubjPKey]});
    +3295         return o;
    +3296     };
    +3297 
    +3298     this.getEncodedHex = function() {
    +3299         var o = this.getASN1Object();
    +3300         this.hTLV = o.getEncodedHex();
    +3301         return this.hTLV;
    +3302     };
    +3303 
    +3304     /**
    +3305      * @name setPubKey
    +3306      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo#
    +3307      * @function
    +3308      * @param {Object} {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object
    +3309      * @since jsrsasign 8.0.0 asn1x509 1.1.0
    +3310      * @description
    +3311      * @example
    +3312      * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo();
    +3313      * pubKey = KEYUTIL.getKey(PKCS8PUBKEYPEM);
    +3314      * spki.setPubKey(pubKey);
    +3315      */
    +3316     this.setPubKey = function(key) {
    +3317 	try {
    +3318 	    if (key instanceof RSAKey) {
    +3319 		var asn1RsaPub = _newObject({
    +3320 		    'seq': [{'int': {'bigint': key.n}}, {'int': {'int': key.e}}]
    +3321 		});
    +3322 		var rsaKeyHex = asn1RsaPub.getEncodedHex();
    +3323 		this.asn1AlgId = new _AlgorithmIdentifier({'name':'rsaEncryption'});
    +3324 		this.asn1SubjPKey = new _DERBitString({'hex':'00'+rsaKeyHex});
    +3325 	    }
    +3326 	} catch(ex) {};
    +3327 
    +3328 	try {
    +3329 	    if (key instanceof KJUR.crypto.ECDSA) {
    +3330 		var asn1Params = new _DERObjectIdentifier({'name': key.curveName});
    +3331 		this.asn1AlgId =
    +3332 		    new _AlgorithmIdentifier({'name': 'ecPublicKey',
    +3333 					      'asn1params': asn1Params});
    +3334 		this.asn1SubjPKey = new _DERBitString({'hex': '00' + key.pubKeyHex});
    +3335 	    }
    +3336 	} catch(ex) {};
    +3337 
    +3338 	try {
    +3339 	    if (key instanceof KJUR.crypto.DSA) {
    +3340 		var asn1Params = new _newObject({
    +3341 		    'seq': [{'int': {'bigint': key.p}},
    +3342 			    {'int': {'bigint': key.q}},
    +3343 			    {'int': {'bigint': key.g}}]
    +3344 		});
    +3345 		this.asn1AlgId =
    +3346 		    new _AlgorithmIdentifier({'name': 'dsa',
    +3347 					      'asn1params': asn1Params});
    +3348 		var pubInt = new _DERInteger({'bigint': key.y});
    +3349 		this.asn1SubjPKey = 
    +3350 		    new _DERBitString({'hex': '00' + pubInt.getEncodedHex()});
    +3351 	    }
    +3352 	} catch(ex) {};
    +3353     };
    +3354 
    +3355     if (params !== undefined) {
    +3356 	this.setPubKey(params);
     3357     }
     3358 };
    -3359 YAHOO.lang.extend(KJUR.asn1.x509.Time, KJUR.asn1.ASN1Object);
    +3359 YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo, KJUR.asn1.ASN1Object);
     3360 
     3361 /**
    -3362  * AlgorithmIdentifier ASN.1 structure class
    -3363  * @name KJUR.asn1.x509.AlgorithmIdentifier
    -3364  * @class AlgorithmIdentifier ASN.1 structure class
    -3365  * @param {Array} params associative array of parameters (ex. {'name': 'SHA1withRSA'})
    +3362  * Time ASN.1 structure class<br/>
    +3363  * @name KJUR.asn1.x509.Time
    +3364  * @class Time ASN.1 structure class
    +3365  * @param {Array} params associative array of parameters (ex. {'str': '130508235959Z'})
     3366  * @extends KJUR.asn1.ASN1Object
    -3367  * @description
    -3368  * The 'params' argument is an associative array and has following parameters:
    -3369  * <ul>
    -3370  * <li>name: algorithm name (MANDATORY, ex. sha1, SHA256withRSA)</li>
    -3371  * <li>asn1params: explicitly specify ASN.1 object for algorithm.
    -3372  * (OPTION)</li>
    -3373  * <li>paramempty: set algorithm parameter to NULL by force.
    -3374  * If paramempty is false, algorithm parameter will be set automatically.
    -3375  * If paramempty is false and algorithm name is "*withDSA" or "withECDSA" parameter field of
    -3376  * AlgorithmIdentifier will be ommitted otherwise
    -3377  * it will be NULL by default.
    -3378  * (OPTION, DEFAULT = false)</li>
    -3379  * </ul>
    -3380  * RSA-PSS algorithm names such as SHA{,256,384,512}withRSAandMGF1 are
    -3381  * special names. They will set a suite of algorithm OID and multiple algorithm
    -3382  * parameters. Its ASN.1 schema is defined in 
    -3383  * <a href="https://tools.ietf.org/html/rfc3447#appendix-A.2.3">RFC 3447 PKCS#1 2.1
    -3384  * section A.2.3</a>.
    -3385  * <blockquote><pre>
    -3386  * id-RSASSA-PSS  OBJECT IDENTIFIER ::= { pkcs-1 10 }
    -3387  * RSASSA-PSS-params ::= SEQUENCE {
    -3388  *   hashAlgorithm      [0] HashAlgorithm    DEFAULT sha1,
    -3389  *   maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
    -3390  *   saltLength         [2] INTEGER          DEFAULT 20,
    -3391  *   trailerField       [3] TrailerField     DEFAULT trailerFieldBC }
    -3392  * mgf1SHA1    MaskGenAlgorithm ::= {
    -3393  *   algorithm   id-mgf1,
    -3394  *   parameters  HashAlgorithm : sha1 }
    -3395  * id-mgf1     OBJECT IDENTIFIER ::= { pkcs-1 8 }
    -3396  * TrailerField ::= INTEGER { trailerFieldBC(1) }
    -3397  * </pre></blockquote>
    -3398  * Here is a table for PSS parameters:
    -3399  * <table>
    -3400  * <tr><th>Name</th><th>alg oid</th><th>pss hash</th><th>maskgen</th></th><th>pss saltlen</th><th>trailer</th></tr>
    -3401  * <tr><td>SHAwithRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>default(sha1)</td><td>default(mgf1sha1)</td><td>default(20)</td><td>default(1)</td></tr>
    -3402  * <tr><td>SHA256withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha256</td><td>mgf1sha256</td><td>32</td><td>default(1)</td></tr>
    -3403  * <tr><td>SHA384withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha384</td><td>mgf1sha384</td><td>48</td><td>default(1)</td></tr>
    -3404  * <tr><td>SHA512withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha512</td><td>mgf1sha512</td><td>64</td><td>default(1)</td></tr>
    -3405  * </table>
    -3406  * Default value is omitted as defined in ASN.1 schema.
    -3407  * These parameters are interoperable to OpenSSL or IAIK toolkit.
    -3408  * <br/>
    -3409  * NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21. 
    -3410  * @example
    -3411  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"})
    -3412  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA"})
    -3413  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA512withRSAandMGF1"}) // set parameters automatically
    -3414  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA", paramempty: true})
    -3415  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "rsaEncryption"})
    -3416  */
    -3417 KJUR.asn1.x509.AlgorithmIdentifier = function(params) {
    -3418     KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);
    -3419     this.nameAlg = null;
    -3420     this.asn1Alg = null;
    -3421     this.asn1Params = null;
    -3422     this.paramEmpty = false;
    -3423 
    -3424     var _KJUR = KJUR,
    -3425 	_KJUR_asn1 = _KJUR.asn1,
    -3426 	_PSSNAME2ASN1TLV = _KJUR_asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;
    -3427 
    -3428     this.getEncodedHex = function() {
    -3429         if (this.nameAlg === null && this.asn1Alg === null) {
    -3430             throw new Error("algorithm not specified");
    -3431         }
    -3432 
    -3433 	// for RSAPSS algorithm name
    -3434 	//  && this.hTLV === null
    -3435 	if (this.nameAlg !== null) {
    -3436 	    var hTLV = null;
    -3437 	    for (var key in _PSSNAME2ASN1TLV) {
    -3438 		if (key === this.nameAlg) {
    -3439 		    hTLV = _PSSNAME2ASN1TLV[key];
    -3440 		}
    -3441 	    }
    -3442 	    if (hTLV !== null) {
    -3443 		this.hTLV = hTLV;
    -3444 		return this.hTLV;
    -3445 	    }
    -3446 	}
    -3447 
    -3448         if (this.nameAlg !== null && this.asn1Alg === null) {
    -3449             this.asn1Alg = _KJUR_asn1.x509.OID.name2obj(this.nameAlg);
    -3450         }
    -3451         var a = [this.asn1Alg];
    -3452         if (this.asn1Params !== null) a.push(this.asn1Params);
    -3453 
    -3454         var o = new _KJUR_asn1.DERSequence({'array': a});
    -3455         this.hTLV = o.getEncodedHex();
    -3456         return this.hTLV;
    -3457     };
    -3458 
    -3459     if (params !== undefined) {
    -3460         if (params.name !== undefined) {
    -3461             this.nameAlg = params.name;
    -3462         }
    -3463         if (params.asn1params !== undefined) {
    -3464             this.asn1Params = params.asn1params;
    -3465         }
    -3466         if (params.paramempty !== undefined) {
    -3467             this.paramEmpty = params.paramempty;
    -3468         }
    -3469     }
    -3470 
    -3471     // set algorithm parameters will be ommitted for
    -3472     // "*withDSA" or "*withECDSA" otherwise will be NULL.
    -3473     if (this.asn1Params === null &&
    -3474 	this.paramEmpty === false &&
    -3475 	this.nameAlg !== null) {
    -3476 
    -3477 	if (this.nameAlg.name !== undefined) {
    -3478 	    this.nameAlg = this.nameAlg.name;
    -3479 	}
    -3480 	var lcNameAlg = this.nameAlg.toLowerCase();
    -3481 
    -3482 	if (lcNameAlg.substr(-7, 7) !== "withdsa" &&
    -3483 	    lcNameAlg.substr(-9, 9) !== "withecdsa") {
    -3484             this.asn1Params = new _KJUR_asn1.DERNull();
    -3485 	}
    -3486     }
    -3487 };
    -3488 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
    -3489 
    -3490 /**
    -3491  * AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names
    -3492  * @const
    -3493  */
    -3494 KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV = {
    -3495     "SHAwithRSAandMGF1":
    -3496     "300d06092a864886f70d01010a3000",
    -3497     "SHA256withRSAandMGF1":
    -3498     "303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",
    -3499     "SHA384withRSAandMGF1":
    -3500     "303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",
    -3501     "SHA512withRSAandMGF1":
    -3502     "303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"
    -3503 };
    -3504 
    -3505 /**
    -3506  * GeneralName ASN.1 structure class<br/>
    -3507  * @name KJUR.asn1.x509.GeneralName
    -3508  * @class GeneralName ASN.1 structure class
    -3509  * @description
    -3510  * <br/>
    -3511  * As for argument 'params' for constructor, you can specify one of
    -3512  * following properties:
    -3513  * <ul>
    -3514  * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li>
    -3515  * <li>dns - dNSName[2] (ex. foo.com)</li>
    -3516  * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
    -3517  * <li>dn - directoryName[4] 
    -3518  * distinguished name string or X500Name class parameters can be
    -3519  * specified (ex. "/C=US/O=Test", {hex: '301c...')</li>
    -3520  * <li>ldapdn - directoryName[4] (ex. O=Test,C=US)</li>
    -3521  * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
    -3522  * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
    -3523  * <li>ip - iPAddress[7] (ex. 192.168.1.1, 2001:db3::43, 3faa0101...)</li>
    -3524  * </ul>
    -3525  * NOTE1: certissuer and certsubj were supported since asn1x509 1.0.10.<br/>
    -3526  * NOTE2: dn and ldapdn were supported since jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    -3527  * NOTE3: ip were supported since jsrsasign 8.0.10 asn1x509 1.1.4.<br/>
    -3528  * NOTE4: X500Name parameters in dn were supported since jsrsasign 8.0.16.<br/>
    -3529  *
    -3530  * Here is definition of the ASN.1 syntax:
    -3531  * <pre>
    -3532  * -- NOTE: under the CHOICE, it will always be explicit.
    -3533  * GeneralName ::= CHOICE {
    -3534  *   otherName                  [0] OtherName,
    -3535  *   rfc822Name                 [1] IA5String,
    -3536  *   dNSName                    [2] IA5String,
    -3537  *   x400Address                [3] ORAddress,
    -3538  *   directoryName              [4] Name,
    -3539  *   ediPartyName               [5] EDIPartyName,
    -3540  *   uniformResourceIdentifier  [6] IA5String,
    -3541  *   iPAddress                  [7] OCTET STRING,
    -3542  *   registeredID               [8] OBJECT IDENTIFIER }
    -3543  * </pre>
    -3544  *
    -3545  * @example
    -3546  * gn = new KJUR.asn1.x509.GeneralName({dn:     '/C=US/O=Test'});
    -3547  * gn = new KJUR.asn1.x509.GeneralName({dn:     X500NameObject);
    -3548  * gn = new KJUR.asn1.x509.GeneralName({dn:     {str: /C=US/O=Test'});
    -3549  * gn = new KJUR.asn1.x509.GeneralName({dn:     {ldapstr: 'O=Test,C=US'});
    -3550  * gn = new KJUR.asn1.x509.GeneralName({dn:     {hex: '301c...'});
    -3551  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certissuer: PEMCERTSTRING});
    -3552  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certsubject: PEMCERTSTRING});
    -3553  * gn = new KJUR.asn1.x509.GeneralName({ip:     '192.168.1.1'});
    -3554  * gn = new KJUR.asn1.x509.GeneralName({ip:     '2001:db4::4:1'});
    -3555  * gn = new KJUR.asn1.x509.GeneralName({ip:     'c0a80101'});
    -3556  * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'});
    -3557  * gn = new KJUR.asn1.x509.GeneralName({dns:    'aaa.com'});
    -3558  * gn = new KJUR.asn1.x509.GeneralName({uri:    'http://aaa.com/'});
    -3559  *
    -3560  * gn = new KJUR.asn1.x509.GeneralName({ldapdn:     'O=Test,C=US'}); // DEPRECATED
    -3561  * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});       // DEPRECATED
    -3562  * gn = new KJUR.asn1.x509.GeneralName({certsubj:   certPEM});       // DEPRECATED
    -3563  */
    -3564 KJUR.asn1.x509.GeneralName = function(params) {
    -3565     KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);
    -3566     var asn1Obj = null,
    -3567 	type = null,
    -3568 	pTag = {rfc822: '81', dns: '82', dn: 'a4',  uri: '86', ip: '87'},
    -3569 	_KJUR = KJUR,
    -3570 	_KJUR_asn1 = _KJUR.asn1,
    -3571 	_DERSequence = _KJUR_asn1.DERSequence,
    -3572 	_DEROctetString = _KJUR_asn1.DEROctetString,
    -3573 	_DERIA5String = _KJUR_asn1.DERIA5String,
    -3574 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -3575 	_ASN1Object = _KJUR_asn1.ASN1Object,
    -3576 	_X500Name = _KJUR_asn1.x509.X500Name,
    -3577 	_pemtohex = pemtohex;
    -3578 	
    -3579     this.explicit = false;
    -3580 
    -3581     this.setByParam = function(params) {
    -3582         var str = null;
    -3583         var v = null;
    -3584 
    -3585 	if (params === undefined) return;
    -3586 
    -3587         if (params.rfc822 !== undefined) {
    -3588             this.type = 'rfc822';
    -3589             v = new _DERIA5String({str: params[this.type]});
    -3590         }
    -3591 
    -3592         if (params.dns !== undefined) {
    -3593             this.type = 'dns';
    -3594             v = new _DERIA5String({str: params[this.type]});
    -3595         }
    -3596 
    -3597         if (params.uri !== undefined) {
    -3598             this.type = 'uri';
    -3599             v = new _DERIA5String({str: params[this.type]});
    -3600         }
    -3601 
    -3602         if (params.dn !== undefined) {
    -3603 	    this.type = 'dn';
    -3604 	    this.explicit = true;
    -3605 	    if (typeof params.dn === "string") {
    -3606 		v = new _X500Name({str: params.dn});
    -3607 	    } else if (params.dn instanceof KJUR.asn1.x509.X500Name) {
    -3608 		v = params.dn;
    -3609 	    } else {
    -3610 		v = new _X500Name(params.dn);
    -3611 	    }
    -3612 	}
    -3613 
    -3614         if (params.ldapdn !== undefined) {
    -3615 	    this.type = 'dn';
    -3616 	    this.explicit = true;
    -3617 	    v = new _X500Name({ldapstr: params.ldapdn});
    -3618 	}
    -3619 
    -3620 	if (params.certissuer !== undefined) {
    -3621 	    this.type = 'dn';
    -3622 	    this.explicit = true;
    -3623 	    var certStr = params.certissuer;
    -3624 	    var certHex = null;
    -3625 
    -3626 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    -3627 		certHex == certStr;
    -3628             }
    -3629 
    -3630 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    -3631 		certHex = _pemtohex(certStr);
    -3632 	    }
    -3633 
    -3634 	    if (certHex == null) throw "certissuer param not cert";
    -3635 	    var x = new X509();
    -3636 	    x.hex = certHex;
    -3637 	    var dnHex = x.getIssuerHex();
    -3638 	    v = new _ASN1Object();
    -3639 	    v.hTLV = dnHex;
    -3640 	}
    -3641 
    -3642 	if (params.certsubj !== undefined) {
    -3643 	    this.type = 'dn';
    -3644 	    this.explicit = true;
    -3645 	    var certStr = params.certsubj;
    -3646 	    var certHex = null;
    -3647 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    -3648 		certHex == certStr;
    -3649             }
    -3650 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    -3651 		certHex = _pemtohex(certStr);
    -3652 	    }
    -3653 	    if (certHex == null) throw "certsubj param not cert";
    -3654 	    var x = new X509();
    -3655 	    x.hex = certHex;
    -3656 	    var dnHex = x.getSubjectHex();
    -3657 	    v = new _ASN1Object();
    -3658 	    v.hTLV = dnHex;
    -3659 	}
    +3367  * @see KJUR.asn1.DERUTCTime
    +3368  * @see KJUR.asn1.DERGeneralizedTime
    +3369  * @description
    +3370  * This class represents Time ASN.1 structure defined in 
    +3371  * <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>
    +3372  * <pre>
    +3373  * Time ::= CHOICE {
    +3374  *      utcTime        UTCTime,
    +3375  *      generalTime    GeneralizedTime }
    +3376  * </pre>
    +3377  *
    +3378  * @example
    +3379  * var t1 = new KJUR.asn1.x509.Time{'str': '130508235959Z'} // UTCTime by default
    +3380  * var t2 = new KJUR.asn1.x509.Time{'type': 'gen',  'str': '20130508235959Z'} // GeneralizedTime
    +3381  */
    +3382 KJUR.asn1.x509.Time = function(params) {
    +3383     KJUR.asn1.x509.Time.superclass.constructor.call(this);
    +3384     var type = null,
    +3385 	timeParams = null,
    +3386 	_KJUR = KJUR,
    +3387 	_KJUR_asn1 = _KJUR.asn1,
    +3388 	_DERUTCTime = _KJUR_asn1.DERUTCTime,
    +3389 	_DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime;
    +3390 
    +3391     this.setTimeParams = function(timeParams) {
    +3392         this.timeParams = timeParams;
    +3393     }
    +3394 
    +3395     this.getEncodedHex = function() {
    +3396         var o = null;
    +3397 
    +3398         if (this.timeParams != null) {
    +3399             if (this.type == "utc") {
    +3400                 o = new _DERUTCTime(this.timeParams);
    +3401             } else {
    +3402                 o = new _DERGeneralizedTime(this.timeParams);
    +3403             }
    +3404         } else {
    +3405             if (this.type == "utc") {
    +3406                 o = new _DERUTCTime();
    +3407             } else {
    +3408                 o = new _DERGeneralizedTime();
    +3409             }
    +3410         }
    +3411         this.TLV = o.getEncodedHex();
    +3412         return this.TLV;
    +3413     };
    +3414 
    +3415     this.type = "utc";
    +3416     if (params !== undefined) {
    +3417         if (params.type !== undefined) {
    +3418             this.type = params.type;
    +3419         } else {
    +3420             if (params.str !== undefined) {
    +3421                 if (params.str.match(/^[0-9]{12}Z$/)) this.type = "utc";
    +3422                 if (params.str.match(/^[0-9]{14}Z$/)) this.type = "gen";
    +3423             }
    +3424         }
    +3425         this.timeParams = params;
    +3426     }
    +3427 };
    +3428 YAHOO.lang.extend(KJUR.asn1.x509.Time, KJUR.asn1.ASN1Object);
    +3429 
    +3430 /**
    +3431  * AlgorithmIdentifier ASN.1 structure class
    +3432  * @name KJUR.asn1.x509.AlgorithmIdentifier
    +3433  * @class AlgorithmIdentifier ASN.1 structure class
    +3434  * @param {Array} params associative array of parameters (ex. {'name': 'SHA1withRSA'})
    +3435  * @extends KJUR.asn1.ASN1Object
    +3436  * @description
    +3437  * The 'params' argument is an associative array and has following parameters:
    +3438  * <ul>
    +3439  * <li>name: algorithm name (MANDATORY, ex. sha1, SHA256withRSA)</li>
    +3440  * <li>asn1params: explicitly specify ASN.1 object for algorithm.
    +3441  * (OPTION)</li>
    +3442  * <li>paramempty: set algorithm parameter to NULL by force.
    +3443  * If paramempty is false, algorithm parameter will be set automatically.
    +3444  * If paramempty is false and algorithm name is "*withDSA" or "withECDSA" parameter field of
    +3445  * AlgorithmIdentifier will be ommitted otherwise
    +3446  * it will be NULL by default.
    +3447  * (OPTION, DEFAULT = false)</li>
    +3448  * </ul>
    +3449  * RSA-PSS algorithm names such as SHA{,256,384,512}withRSAandMGF1 are
    +3450  * special names. They will set a suite of algorithm OID and multiple algorithm
    +3451  * parameters. Its ASN.1 schema is defined in 
    +3452  * <a href="https://tools.ietf.org/html/rfc3447#appendix-A.2.3">RFC 3447 PKCS#1 2.1
    +3453  * section A.2.3</a>.
    +3454  * <blockquote><pre>
    +3455  * id-RSASSA-PSS  OBJECT IDENTIFIER ::= { pkcs-1 10 }
    +3456  * RSASSA-PSS-params ::= SEQUENCE {
    +3457  *   hashAlgorithm      [0] HashAlgorithm    DEFAULT sha1,
    +3458  *   maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
    +3459  *   saltLength         [2] INTEGER          DEFAULT 20,
    +3460  *   trailerField       [3] TrailerField     DEFAULT trailerFieldBC }
    +3461  * mgf1SHA1    MaskGenAlgorithm ::= {
    +3462  *   algorithm   id-mgf1,
    +3463  *   parameters  HashAlgorithm : sha1 }
    +3464  * id-mgf1     OBJECT IDENTIFIER ::= { pkcs-1 8 }
    +3465  * TrailerField ::= INTEGER { trailerFieldBC(1) }
    +3466  * </pre></blockquote>
    +3467  * Here is a table for PSS parameters:
    +3468  * <table>
    +3469  * <tr><th>Name</th><th>alg oid</th><th>pss hash</th><th>maskgen</th></th><th>pss saltlen</th><th>trailer</th></tr>
    +3470  * <tr><td>SHAwithRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>default(sha1)</td><td>default(mgf1sha1)</td><td>default(20)</td><td>default(1)</td></tr>
    +3471  * <tr><td>SHA256withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha256</td><td>mgf1sha256</td><td>32</td><td>default(1)</td></tr>
    +3472  * <tr><td>SHA384withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha384</td><td>mgf1sha384</td><td>48</td><td>default(1)</td></tr>
    +3473  * <tr><td>SHA512withRSAandMGF1</td><td>1.2.840.113549.1.1.10(rsapss)</td><td>sha512</td><td>mgf1sha512</td><td>64</td><td>default(1)</td></tr>
    +3474  * </table>
    +3475  * Default value is omitted as defined in ASN.1 schema.
    +3476  * These parameters are interoperable to OpenSSL or IAIK toolkit.
    +3477  * <br/>
    +3478  * NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21. 
    +3479  * @example
    +3480  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"})
    +3481  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA"})
    +3482  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA512withRSAandMGF1"}) // set parameters automatically
    +3483  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA", paramempty: true})
    +3484  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "rsaEncryption"})
    +3485  */
    +3486 KJUR.asn1.x509.AlgorithmIdentifier = function(params) {
    +3487     KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);
    +3488     this.nameAlg = null;
    +3489     this.asn1Alg = null;
    +3490     this.asn1Params = null;
    +3491     this.paramEmpty = false;
    +3492 
    +3493     var _KJUR = KJUR,
    +3494 	_KJUR_asn1 = _KJUR.asn1,
    +3495 	_PSSNAME2ASN1TLV = _KJUR_asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;
    +3496 
    +3497     this.getEncodedHex = function() {
    +3498         if (this.nameAlg === null && this.asn1Alg === null) {
    +3499             throw new Error("algorithm not specified");
    +3500         }
    +3501 
    +3502 	// for RSAPSS algorithm name
    +3503 	//  && this.hTLV === null
    +3504 	if (this.nameAlg !== null) {
    +3505 	    var hTLV = null;
    +3506 	    for (var key in _PSSNAME2ASN1TLV) {
    +3507 		if (key === this.nameAlg) {
    +3508 		    hTLV = _PSSNAME2ASN1TLV[key];
    +3509 		}
    +3510 	    }
    +3511 	    if (hTLV !== null) {
    +3512 		this.hTLV = hTLV;
    +3513 		return this.hTLV;
    +3514 	    }
    +3515 	}
    +3516 
    +3517         if (this.nameAlg !== null && this.asn1Alg === null) {
    +3518             this.asn1Alg = _KJUR_asn1.x509.OID.name2obj(this.nameAlg);
    +3519         }
    +3520         var a = [this.asn1Alg];
    +3521         if (this.asn1Params !== null) a.push(this.asn1Params);
    +3522 
    +3523         var o = new _KJUR_asn1.DERSequence({'array': a});
    +3524         this.hTLV = o.getEncodedHex();
    +3525         return this.hTLV;
    +3526     };
    +3527 
    +3528     if (params !== undefined) {
    +3529         if (params.name !== undefined) {
    +3530             this.nameAlg = params.name;
    +3531         }
    +3532         if (params.asn1params !== undefined) {
    +3533             this.asn1Params = params.asn1params;
    +3534         }
    +3535         if (params.paramempty !== undefined) {
    +3536             this.paramEmpty = params.paramempty;
    +3537         }
    +3538     }
    +3539 
    +3540     // set algorithm parameters will be ommitted for
    +3541     // "*withDSA" or "*withECDSA" otherwise will be NULL.
    +3542     if (this.asn1Params === null &&
    +3543 	this.paramEmpty === false &&
    +3544 	this.nameAlg !== null) {
    +3545 
    +3546 	if (this.nameAlg.name !== undefined) {
    +3547 	    this.nameAlg = this.nameAlg.name;
    +3548 	}
    +3549 	var lcNameAlg = this.nameAlg.toLowerCase();
    +3550 
    +3551 	if (lcNameAlg.substr(-7, 7) !== "withdsa" &&
    +3552 	    lcNameAlg.substr(-9, 9) !== "withecdsa") {
    +3553             this.asn1Params = new _KJUR_asn1.DERNull();
    +3554 	}
    +3555     }
    +3556 };
    +3557 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
    +3558 
    +3559 /**
    +3560  * AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names
    +3561  * @const
    +3562  */
    +3563 KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV = {
    +3564     "SHAwithRSAandMGF1":
    +3565     "300d06092a864886f70d01010a3000",
    +3566     "SHA256withRSAandMGF1":
    +3567     "303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",
    +3568     "SHA384withRSAandMGF1":
    +3569     "303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",
    +3570     "SHA512withRSAandMGF1":
    +3571     "303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"
    +3572 };
    +3573 
    +3574 /**
    +3575  * GeneralName ASN.1 structure class<br/>
    +3576  * @name KJUR.asn1.x509.GeneralName
    +3577  * @class GeneralName ASN.1 structure class
    +3578  * @description
    +3579  * <br/>
    +3580  * As for argument 'params' for constructor, you can specify one of
    +3581  * following properties:
    +3582  * <ul>
    +3583  * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li>
    +3584  * <li>dns - dNSName[2] (ex. foo.com)</li>
    +3585  * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
    +3586  * <li>dn - directoryName[4] 
    +3587  * distinguished name string or X500Name class parameters can be
    +3588  * specified (ex. "/C=US/O=Test", {hex: '301c...')</li>
    +3589  * <li>ldapdn - directoryName[4] (ex. O=Test,C=US)</li>
    +3590  * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
    +3591  * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
    +3592  * <li>ip - iPAddress[7] (ex. 192.168.1.1, 2001:db3::43, 3faa0101...)</li>
    +3593  * </ul>
    +3594  * NOTE1: certissuer and certsubj were supported since asn1x509 1.0.10.<br/>
    +3595  * NOTE2: dn and ldapdn were supported since jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    +3596  * NOTE3: ip were supported since jsrsasign 8.0.10 asn1x509 1.1.4.<br/>
    +3597  * NOTE4: X500Name parameters in dn were supported since jsrsasign 8.0.16.<br/>
    +3598  *
    +3599  * Here is definition of the ASN.1 syntax:
    +3600  * <pre>
    +3601  * -- NOTE: under the CHOICE, it will always be explicit.
    +3602  * GeneralName ::= CHOICE {
    +3603  *   otherName                  [0] OtherName,
    +3604  *   rfc822Name                 [1] IA5String,
    +3605  *   dNSName                    [2] IA5String,
    +3606  *   x400Address                [3] ORAddress,
    +3607  *   directoryName              [4] Name,
    +3608  *   ediPartyName               [5] EDIPartyName,
    +3609  *   uniformResourceIdentifier  [6] IA5String,
    +3610  *   iPAddress                  [7] OCTET STRING,
    +3611  *   registeredID               [8] OBJECT IDENTIFIER }
    +3612  * </pre>
    +3613  *
    +3614  * @example
    +3615  * gn = new KJUR.asn1.x509.GeneralName({dn:     '/C=US/O=Test'});
    +3616  * gn = new KJUR.asn1.x509.GeneralName({dn:     X500NameObject);
    +3617  * gn = new KJUR.asn1.x509.GeneralName({dn:     {str: /C=US/O=Test'});
    +3618  * gn = new KJUR.asn1.x509.GeneralName({dn:     {ldapstr: 'O=Test,C=US'});
    +3619  * gn = new KJUR.asn1.x509.GeneralName({dn:     {hex: '301c...'});
    +3620  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certissuer: PEMCERTSTRING});
    +3621  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certsubject: PEMCERTSTRING});
    +3622  * gn = new KJUR.asn1.x509.GeneralName({ip:     '192.168.1.1'});
    +3623  * gn = new KJUR.asn1.x509.GeneralName({ip:     '2001:db4::4:1'});
    +3624  * gn = new KJUR.asn1.x509.GeneralName({ip:     'c0a80101'});
    +3625  * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'});
    +3626  * gn = new KJUR.asn1.x509.GeneralName({dns:    'aaa.com'});
    +3627  * gn = new KJUR.asn1.x509.GeneralName({uri:    'http://aaa.com/'});
    +3628  *
    +3629  * gn = new KJUR.asn1.x509.GeneralName({ldapdn:     'O=Test,C=US'}); // DEPRECATED
    +3630  * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});       // DEPRECATED
    +3631  * gn = new KJUR.asn1.x509.GeneralName({certsubj:   certPEM});       // DEPRECATED
    +3632  */
    +3633 KJUR.asn1.x509.GeneralName = function(params) {
    +3634     KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);
    +3635     var asn1Obj = null,
    +3636 	type = null,
    +3637 	pTag = {rfc822: '81', dns: '82', dn: 'a4',  uri: '86', ip: '87'},
    +3638 	_KJUR = KJUR,
    +3639 	_KJUR_asn1 = _KJUR.asn1,
    +3640 	_DERSequence = _KJUR_asn1.DERSequence,
    +3641 	_DEROctetString = _KJUR_asn1.DEROctetString,
    +3642 	_DERIA5String = _KJUR_asn1.DERIA5String,
    +3643 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +3644 	_ASN1Object = _KJUR_asn1.ASN1Object,
    +3645 	_X500Name = _KJUR_asn1.x509.X500Name,
    +3646 	_pemtohex = pemtohex;
    +3647 	
    +3648     this.explicit = false;
    +3649 
    +3650     this.setByParam = function(params) {
    +3651         var str = null;
    +3652         var v = null;
    +3653 
    +3654 	if (params === undefined) return;
    +3655 
    +3656         if (params.rfc822 !== undefined) {
    +3657             this.type = 'rfc822';
    +3658             v = new _DERIA5String({str: params[this.type]});
    +3659         }
     3660 
    -3661 	if (params.ip !== undefined) {
    -3662 	    this.type = 'ip';
    -3663 	    this.explicit = false;
    -3664 	    var ip = params.ip;
    -3665 	    var hIP;
    -3666 	    var malformedIPMsg = "malformed IP address";
    -3667 	    if (ip.match(/^[0-9.]+[.][0-9.]+$/)) { // ipv4
    -3668 		hIP = intarystrtohex("[" + ip.split(".").join(",") + "]");
    -3669 		if (hIP.length !== 8) throw malformedIPMsg;
    -3670 	    } else if (ip.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)) { // ipv6
    -3671 		hIP = ipv6tohex(ip);
    -3672 	    } else if (ip.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)) { // hex
    -3673 		hIP = ip;
    -3674 	    } else {
    -3675 		throw malformedIPMsg;
    -3676 	    }
    -3677 	    v = new _DEROctetString({hex: hIP});
    -3678 	}
    -3679 
    -3680         if (this.type == null)
    -3681             throw "unsupported type in params=" + params;
    -3682         this.asn1Obj = new _DERTaggedObject({'explicit': this.explicit,
    -3683                                              'tag': pTag[this.type],
    -3684                                              'obj': v});
    -3685     };
    -3686 
    -3687     this.getEncodedHex = function() {
    -3688         return this.asn1Obj.getEncodedHex();
    -3689     }
    -3690 
    -3691     if (params !== undefined) {
    -3692         this.setByParam(params);
    -3693     }
    +3661         if (params.dns !== undefined) {
    +3662             this.type = 'dns';
    +3663             v = new _DERIA5String({str: params[this.type]});
    +3664         }
    +3665 
    +3666         if (params.uri !== undefined) {
    +3667             this.type = 'uri';
    +3668             v = new _DERIA5String({str: params[this.type]});
    +3669         }
    +3670 
    +3671         if (params.dn !== undefined) {
    +3672 	    this.type = 'dn';
    +3673 	    this.explicit = true;
    +3674 	    if (typeof params.dn === "string") {
    +3675 		v = new _X500Name({str: params.dn});
    +3676 	    } else if (params.dn instanceof KJUR.asn1.x509.X500Name) {
    +3677 		v = params.dn;
    +3678 	    } else {
    +3679 		v = new _X500Name(params.dn);
    +3680 	    }
    +3681 	}
    +3682 
    +3683         if (params.ldapdn !== undefined) {
    +3684 	    this.type = 'dn';
    +3685 	    this.explicit = true;
    +3686 	    v = new _X500Name({ldapstr: params.ldapdn});
    +3687 	}
    +3688 
    +3689 	if (params.certissuer !== undefined) {
    +3690 	    this.type = 'dn';
    +3691 	    this.explicit = true;
    +3692 	    var certStr = params.certissuer;
    +3693 	    var certHex = null;
     3694 
    -3695 };
    -3696 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object);
    -3697 
    -3698 /**
    -3699  * GeneralNames ASN.1 structure class<br/>
    -3700  * @name KJUR.asn1.x509.GeneralNames
    -3701  * @class GeneralNames ASN.1 structure class
    -3702  * @description
    -3703  * <br/>
    -3704  * <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
    -3705  * @example
    -3706  * gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]);
    -3707  *
    -3708  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -3709  */
    -3710 KJUR.asn1.x509.GeneralNames = function(paramsArray) {
    -3711     KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);
    -3712     var asn1Array = null,
    -3713 	_KJUR = KJUR,
    -3714 	_KJUR_asn1 = _KJUR.asn1;
    -3715 
    -3716     /**
    -3717      * set a array of {@link KJUR.asn1.x509.GeneralName} parameters<br/>
    -3718      * @name setByParamArray
    -3719      * @memberOf KJUR.asn1.x509.GeneralNames#
    -3720      * @function
    -3721      * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames}
    -3722      * @description
    -3723      * <br/>
    -3724      * <h4>EXAMPLES</h4>
    -3725      * @example
    -3726      * gns = new KJUR.asn1.x509.GeneralNames();
    -3727      * gns.setByParamArray([{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]);
    -3728      */
    -3729     this.setByParamArray = function(paramsArray) {
    -3730         for (var i = 0; i < paramsArray.length; i++) {
    -3731             var o = new _KJUR_asn1.x509.GeneralName(paramsArray[i]);
    -3732             this.asn1Array.push(o);
    -3733         }
    -3734     };
    -3735 
    -3736     this.getEncodedHex = function() {
    -3737         var o = new _KJUR_asn1.DERSequence({'array': this.asn1Array});
    -3738         return o.getEncodedHex();
    -3739     };
    -3740 
    -3741     this.asn1Array = new Array();
    -3742     if (typeof paramsArray != "undefined") {
    -3743         this.setByParamArray(paramsArray);
    -3744     }
    -3745 };
    -3746 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object);
    -3747 
    -3748 /**
    -3749  * static object for OID
    -3750  * @name KJUR.asn1.x509.OID
    -3751  * @class static object for OID
    -3752  * @property {Assoc Array} atype2oidList for short attribute type name and oid (ex. 'C' and '2.5.4.6')
    -3753  * @property {Assoc Array} name2oidList for oid name and oid (ex. 'keyUsage' and '2.5.29.15')
    -3754  * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object
    -3755  * @description
    -3756  * This class defines OID name and values.
    -3757  * AttributeType names registered in OID.atype2oidList are following:
    -3758  * <table style="border-width: thin; border-style: solid; witdh: 100%">
    -3759  * <tr><th>short</th><th>long</th><th>OID</th></tr>
    -3760  * <tr><td>CN</td>commonName<td></td><td>2.5.4.3</td></tr>
    -3761  * <tr><td>L</td><td>localityName</td><td>2.5.4.7</td></tr>
    -3762  * <tr><td>ST</td><td>stateOrProvinceName</td><td>2.5.4.8</td></tr>
    -3763  * <tr><td>O</td><td>organizationName</td><td>2.5.4.10</td></tr>
    -3764  * <tr><td>OU</td><td>organizationalUnitName</td><td>2.5.4.11</td></tr>
    -3765  * <tr><td>C</td><td></td>countryName<td>2.5.4.6</td></tr>
    -3766  * <tr><td>STREET</td>streetAddress<td></td><td>2.5.4.6</td></tr>
    -3767  * <tr><td>DC</td><td>domainComponent</td><td>0.9.2342.19200300.100.1.25</td></tr>
    -3768  * <tr><td>UID</td><td>userId</td><td>0.9.2342.19200300.100.1.1</td></tr>
    -3769  * <tr><td>SN</td><td>surname</td><td>2.5.4.4</td></tr>
    -3770  * <tr><td>DN</td><td>distinguishedName</td><td>2.5.4.49</td></tr>
    -3771  * <tr><td>E</td><td>emailAddress</td><td>1.2.840.113549.1.9.1</td></tr>
    -3772  * <tr><td></td><td>businessCategory</td><td>2.5.4.15</td></tr>
    -3773  * <tr><td></td><td>postalCode</td><td>2.5.4.17</td></tr>
    -3774  * <tr><td></td><td>jurisdictionOfIncorporationL</td><td>1.3.6.1.4.1.311.60.2.1.1</td></tr>
    -3775  * <tr><td></td><td>jurisdictionOfIncorporationSP</td><td>1.3.6.1.4.1.311.60.2.1.2</td></tr>
    -3776  * <tr><td></td><td>jurisdictionOfIncorporationC</td><td>1.3.6.1.4.1.311.60.2.1.3</td></tr>
    -3777  * </table>
    -3778  *
    -3779  * @example
    -3780  */
    -3781 KJUR.asn1.x509.OID = new function(params) {
    -3782     this.atype2oidList = {
    -3783 	// RFC 4514 AttributeType name string (MUST recognized)
    -3784         'CN':		'2.5.4.3',
    -3785         'L':		'2.5.4.7',
    -3786         'ST':		'2.5.4.8',
    -3787         'O':		'2.5.4.10',
    -3788         'OU':		'2.5.4.11',
    -3789         'C':		'2.5.4.6',
    -3790         'STREET':	'2.5.4.9',
    -3791         'DC':		'0.9.2342.19200300.100.1.25',
    -3792         'UID':		'0.9.2342.19200300.100.1.1',
    -3793 	// other AttributeType name string
    -3794 	// http://blog.livedoor.jp/k_urushima/archives/656114.html
    -3795         'SN':		'2.5.4.4', // surname
    -3796         'T':		'2.5.4.12', // title
    -3797         'DN':		'2.5.4.49', // distinguishedName
    -3798         'E':		'1.2.840.113549.1.9.1', // emailAddress in MS.NET or Bouncy
    -3799 	// other AttributeType name string (no short name)
    -3800 	'description':			'2.5.4.13',
    -3801 	'businessCategory':		'2.5.4.15',
    -3802 	'postalCode':			'2.5.4.17',
    -3803 	'serialNumber':			'2.5.4.5',
    -3804 	'uniqueIdentifier':		'2.5.4.45',
    -3805 	'organizationIdentifier':	'2.5.4.97',
    -3806 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    -3807 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    -3808 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3'
    -3809     };
    -3810     this.name2oidList = {
    -3811         'sha1':                 '1.3.14.3.2.26',
    -3812         'sha256':               '2.16.840.1.101.3.4.2.1',
    -3813         'sha384':               '2.16.840.1.101.3.4.2.2',
    -3814         'sha512':               '2.16.840.1.101.3.4.2.3',
    -3815         'sha224':               '2.16.840.1.101.3.4.2.4',
    -3816         'md5':                  '1.2.840.113549.2.5',
    -3817         'md2':                  '1.3.14.7.2.2.1',
    -3818         'ripemd160':            '1.3.36.3.2.1',
    -3819 
    -3820         'MD2withRSA':           '1.2.840.113549.1.1.2',
    -3821         'MD4withRSA':           '1.2.840.113549.1.1.3',
    -3822         'MD5withRSA':           '1.2.840.113549.1.1.4',
    -3823         'SHA1withRSA':          '1.2.840.113549.1.1.5',
    -3824 	'pkcs1-MGF':		'1.2.840.113549.1.1.8',
    -3825 	'rsaPSS':		'1.2.840.113549.1.1.10',
    -3826         'SHA224withRSA':        '1.2.840.113549.1.1.14',
    -3827         'SHA256withRSA':        '1.2.840.113549.1.1.11',
    -3828         'SHA384withRSA':        '1.2.840.113549.1.1.12',
    -3829         'SHA512withRSA':        '1.2.840.113549.1.1.13',
    -3830 
    -3831         'SHA1withECDSA':        '1.2.840.10045.4.1',
    -3832         'SHA224withECDSA':      '1.2.840.10045.4.3.1',
    -3833         'SHA256withECDSA':      '1.2.840.10045.4.3.2',
    -3834         'SHA384withECDSA':      '1.2.840.10045.4.3.3',
    -3835         'SHA512withECDSA':      '1.2.840.10045.4.3.4',
    -3836 
    -3837         'dsa':                  '1.2.840.10040.4.1',
    -3838         'SHA1withDSA':          '1.2.840.10040.4.3',
    -3839         'SHA224withDSA':        '2.16.840.1.101.3.4.3.1',
    -3840         'SHA256withDSA':        '2.16.840.1.101.3.4.3.2',
    -3841 
    -3842         'rsaEncryption':        '1.2.840.113549.1.1.1',
    -3843 
    -3844 	// X.500 AttributeType defined in RFC 4514
    -3845         'commonName':			'2.5.4.3',
    -3846         'countryName':			'2.5.4.6',
    -3847         'localityName':			'2.5.4.7',
    -3848         'stateOrProvinceName':		'2.5.4.8',
    -3849         'streetAddress':		'2.5.4.9',
    -3850         'organizationName':		'2.5.4.10',
    -3851         'organizationalUnitName':	'2.5.4.11',
    -3852         'domainComponent':		'0.9.2342.19200300.100.1.25',
    -3853         'userId':			'0.9.2342.19200300.100.1.1',
    -3854 	// other AttributeType name string
    -3855 	'surname':			'2.5.4.4',
    -3856         'title':			'2.5.4.12',
    -3857 	'distinguishedName':		'2.5.4.49',
    -3858 	'emailAddress':			'1.2.840.113549.1.9.1',
    -3859 	// other AttributeType name string (no short name)
    -3860 	'description':			'2.5.4.13',
    -3861 	'businessCategory':		'2.5.4.15',
    -3862 	'postalCode':			'2.5.4.17',
    -3863 	'uniqueIdentifier':		'2.5.4.45',
    -3864 	'organizationIdentifier':	'2.5.4.97',
    -3865 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    -3866 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    -3867 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3',
    -3868 
    -3869         'subjectKeyIdentifier': '2.5.29.14',
    -3870         'keyUsage':             '2.5.29.15',
    -3871         'subjectAltName':       '2.5.29.17',
    -3872         'issuerAltName':        '2.5.29.18',
    -3873         'basicConstraints':     '2.5.29.19',
    -3874         'cRLNumber':     	'2.5.29.20',
    -3875         'cRLReason':     	'2.5.29.21',
    -3876         'nameConstraints':      '2.5.29.30',
    -3877         'cRLDistributionPoints':'2.5.29.31',
    -3878         'certificatePolicies':  '2.5.29.32',
    -3879         'anyPolicy':  		'2.5.29.32.0',
    -3880         'authorityKeyIdentifier':'2.5.29.35',
    -3881         'policyConstraints':    '2.5.29.36',
    -3882         'extKeyUsage':          '2.5.29.37',
    -3883         'authorityInfoAccess':  '1.3.6.1.5.5.7.1.1',
    -3884         'ocsp':                 '1.3.6.1.5.5.7.48.1',
    -3885         'ocspBasic':            '1.3.6.1.5.5.7.48.1.1',
    -3886         'ocspNonce':            '1.3.6.1.5.5.7.48.1.2',
    -3887         'ocspNoCheck':          '1.3.6.1.5.5.7.48.1.5',
    -3888         'caIssuers':            '1.3.6.1.5.5.7.48.2',
    -3889 
    -3890         'anyExtendedKeyUsage':  '2.5.29.37.0',
    -3891         'serverAuth':           '1.3.6.1.5.5.7.3.1',
    -3892         'clientAuth':           '1.3.6.1.5.5.7.3.2',
    -3893         'codeSigning':          '1.3.6.1.5.5.7.3.3',
    -3894         'emailProtection':      '1.3.6.1.5.5.7.3.4',
    -3895         'timeStamping':         '1.3.6.1.5.5.7.3.8',
    -3896         'ocspSigning':          '1.3.6.1.5.5.7.3.9',
    -3897 
    -3898         'ecPublicKey':          '1.2.840.10045.2.1',
    -3899         'secp256r1':            '1.2.840.10045.3.1.7',
    -3900         'secp256k1':            '1.3.132.0.10',
    -3901         'secp384r1':            '1.3.132.0.34',
    -3902 
    -3903         'pkcs5PBES2':           '1.2.840.113549.1.5.13',
    -3904         'pkcs5PBKDF2':          '1.2.840.113549.1.5.12',
    +3695 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    +3696 		certHex == certStr;
    +3697             }
    +3698 
    +3699 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    +3700 		certHex = _pemtohex(certStr);
    +3701 	    }
    +3702 
    +3703 	    if (certHex == null) throw "certissuer param not cert";
    +3704 	    var x = new X509();
    +3705 	    x.hex = certHex;
    +3706 	    var dnHex = x.getIssuerHex();
    +3707 	    v = new _ASN1Object();
    +3708 	    v.hTLV = dnHex;
    +3709 	}
    +3710 
    +3711 	if (params.certsubj !== undefined) {
    +3712 	    this.type = 'dn';
    +3713 	    this.explicit = true;
    +3714 	    var certStr = params.certsubj;
    +3715 	    var certHex = null;
    +3716 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    +3717 		certHex == certStr;
    +3718             }
    +3719 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    +3720 		certHex = _pemtohex(certStr);
    +3721 	    }
    +3722 	    if (certHex == null) throw "certsubj param not cert";
    +3723 	    var x = new X509();
    +3724 	    x.hex = certHex;
    +3725 	    var dnHex = x.getSubjectHex();
    +3726 	    v = new _ASN1Object();
    +3727 	    v.hTLV = dnHex;
    +3728 	}
    +3729 
    +3730 	if (params.ip !== undefined) {
    +3731 	    this.type = 'ip';
    +3732 	    this.explicit = false;
    +3733 	    var ip = params.ip;
    +3734 	    var hIP;
    +3735 	    var malformedIPMsg = "malformed IP address";
    +3736 	    if (ip.match(/^[0-9.]+[.][0-9.]+$/)) { // ipv4
    +3737 		hIP = intarystrtohex("[" + ip.split(".").join(",") + "]");
    +3738 		if (hIP.length !== 8) throw malformedIPMsg;
    +3739 	    } else if (ip.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)) { // ipv6
    +3740 		hIP = ipv6tohex(ip);
    +3741 	    } else if (ip.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)) { // hex
    +3742 		hIP = ip;
    +3743 	    } else {
    +3744 		throw malformedIPMsg;
    +3745 	    }
    +3746 	    v = new _DEROctetString({hex: hIP});
    +3747 	}
    +3748 
    +3749         if (this.type == null)
    +3750             throw "unsupported type in params=" + params;
    +3751         this.asn1Obj = new _DERTaggedObject({'explicit': this.explicit,
    +3752                                              'tag': pTag[this.type],
    +3753                                              'obj': v});
    +3754     };
    +3755 
    +3756     this.getEncodedHex = function() {
    +3757         return this.asn1Obj.getEncodedHex();
    +3758     }
    +3759 
    +3760     if (params !== undefined) {
    +3761         this.setByParam(params);
    +3762     }
    +3763 
    +3764 };
    +3765 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object);
    +3766 
    +3767 /**
    +3768  * GeneralNames ASN.1 structure class<br/>
    +3769  * @name KJUR.asn1.x509.GeneralNames
    +3770  * @class GeneralNames ASN.1 structure class
    +3771  * @description
    +3772  * <br/>
    +3773  * <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
    +3774  * @example
    +3775  * gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]);
    +3776  *
    +3777  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +3778  */
    +3779 KJUR.asn1.x509.GeneralNames = function(paramsArray) {
    +3780     KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);
    +3781     var asn1Array = null,
    +3782 	_KJUR = KJUR,
    +3783 	_KJUR_asn1 = _KJUR.asn1;
    +3784 
    +3785     /**
    +3786      * set a array of {@link KJUR.asn1.x509.GeneralName} parameters<br/>
    +3787      * @name setByParamArray
    +3788      * @memberOf KJUR.asn1.x509.GeneralNames#
    +3789      * @function
    +3790      * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames}
    +3791      * @description
    +3792      * <br/>
    +3793      * <h4>EXAMPLES</h4>
    +3794      * @example
    +3795      * gns = new KJUR.asn1.x509.GeneralNames();
    +3796      * gns.setByParamArray([{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]);
    +3797      */
    +3798     this.setByParamArray = function(paramsArray) {
    +3799         for (var i = 0; i < paramsArray.length; i++) {
    +3800             var o = new _KJUR_asn1.x509.GeneralName(paramsArray[i]);
    +3801             this.asn1Array.push(o);
    +3802         }
    +3803     };
    +3804 
    +3805     this.getEncodedHex = function() {
    +3806         var o = new _KJUR_asn1.DERSequence({'array': this.asn1Array});
    +3807         return o.getEncodedHex();
    +3808     };
    +3809 
    +3810     this.asn1Array = new Array();
    +3811     if (typeof paramsArray != "undefined") {
    +3812         this.setByParamArray(paramsArray);
    +3813     }
    +3814 };
    +3815 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object);
    +3816 
    +3817 /**
    +3818  * static object for OID
    +3819  * @name KJUR.asn1.x509.OID
    +3820  * @class static object for OID
    +3821  * @property {Assoc Array} atype2oidList for short attribute type name and oid (ex. 'C' and '2.5.4.6')
    +3822  * @property {Assoc Array} name2oidList for oid name and oid (ex. 'keyUsage' and '2.5.29.15')
    +3823  * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object
    +3824  * @description
    +3825  * This class defines OID name and values.
    +3826  * AttributeType names registered in OID.atype2oidList are following:
    +3827  * <table style="border-width: thin; border-style: solid; witdh: 100%">
    +3828  * <tr><th>short</th><th>long</th><th>OID</th></tr>
    +3829  * <tr><td>CN</td>commonName<td></td><td>2.5.4.3</td></tr>
    +3830  * <tr><td>L</td><td>localityName</td><td>2.5.4.7</td></tr>
    +3831  * <tr><td>ST</td><td>stateOrProvinceName</td><td>2.5.4.8</td></tr>
    +3832  * <tr><td>O</td><td>organizationName</td><td>2.5.4.10</td></tr>
    +3833  * <tr><td>OU</td><td>organizationalUnitName</td><td>2.5.4.11</td></tr>
    +3834  * <tr><td>C</td><td></td>countryName<td>2.5.4.6</td></tr>
    +3835  * <tr><td>STREET</td>streetAddress<td></td><td>2.5.4.6</td></tr>
    +3836  * <tr><td>DC</td><td>domainComponent</td><td>0.9.2342.19200300.100.1.25</td></tr>
    +3837  * <tr><td>UID</td><td>userId</td><td>0.9.2342.19200300.100.1.1</td></tr>
    +3838  * <tr><td>SN</td><td>surname</td><td>2.5.4.4</td></tr>
    +3839  * <tr><td>DN</td><td>distinguishedName</td><td>2.5.4.49</td></tr>
    +3840  * <tr><td>E</td><td>emailAddress</td><td>1.2.840.113549.1.9.1</td></tr>
    +3841  * <tr><td></td><td>businessCategory</td><td>2.5.4.15</td></tr>
    +3842  * <tr><td></td><td>postalCode</td><td>2.5.4.17</td></tr>
    +3843  * <tr><td></td><td>jurisdictionOfIncorporationL</td><td>1.3.6.1.4.1.311.60.2.1.1</td></tr>
    +3844  * <tr><td></td><td>jurisdictionOfIncorporationSP</td><td>1.3.6.1.4.1.311.60.2.1.2</td></tr>
    +3845  * <tr><td></td><td>jurisdictionOfIncorporationC</td><td>1.3.6.1.4.1.311.60.2.1.3</td></tr>
    +3846  * </table>
    +3847  *
    +3848  * @example
    +3849  */
    +3850 KJUR.asn1.x509.OID = new function(params) {
    +3851     this.atype2oidList = {
    +3852 	// RFC 4514 AttributeType name string (MUST recognized)
    +3853         'CN':		'2.5.4.3',
    +3854         'L':		'2.5.4.7',
    +3855         'ST':		'2.5.4.8',
    +3856         'O':		'2.5.4.10',
    +3857         'OU':		'2.5.4.11',
    +3858         'C':		'2.5.4.6',
    +3859         'STREET':	'2.5.4.9',
    +3860         'DC':		'0.9.2342.19200300.100.1.25',
    +3861         'UID':		'0.9.2342.19200300.100.1.1',
    +3862 	// other AttributeType name string
    +3863 	// http://blog.livedoor.jp/k_urushima/archives/656114.html
    +3864         'SN':		'2.5.4.4', // surname
    +3865         'T':		'2.5.4.12', // title
    +3866         'DN':		'2.5.4.49', // distinguishedName
    +3867         'E':		'1.2.840.113549.1.9.1', // emailAddress in MS.NET or Bouncy
    +3868 	// other AttributeType name string (no short name)
    +3869 	'description':			'2.5.4.13',
    +3870 	'businessCategory':		'2.5.4.15',
    +3871 	'postalCode':			'2.5.4.17',
    +3872 	'serialNumber':			'2.5.4.5',
    +3873 	'uniqueIdentifier':		'2.5.4.45',
    +3874 	'organizationIdentifier':	'2.5.4.97',
    +3875 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    +3876 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    +3877 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3'
    +3878     };
    +3879     this.name2oidList = {
    +3880         'sha1':                 '1.3.14.3.2.26',
    +3881         'sha256':               '2.16.840.1.101.3.4.2.1',
    +3882         'sha384':               '2.16.840.1.101.3.4.2.2',
    +3883         'sha512':               '2.16.840.1.101.3.4.2.3',
    +3884         'sha224':               '2.16.840.1.101.3.4.2.4',
    +3885         'md5':                  '1.2.840.113549.2.5',
    +3886         'md2':                  '1.3.14.7.2.2.1',
    +3887         'ripemd160':            '1.3.36.3.2.1',
    +3888 
    +3889         'MD2withRSA':           '1.2.840.113549.1.1.2',
    +3890         'MD4withRSA':           '1.2.840.113549.1.1.3',
    +3891         'MD5withRSA':           '1.2.840.113549.1.1.4',
    +3892         'SHA1withRSA':          '1.2.840.113549.1.1.5',
    +3893 	'pkcs1-MGF':		'1.2.840.113549.1.1.8',
    +3894 	'rsaPSS':		'1.2.840.113549.1.1.10',
    +3895         'SHA224withRSA':        '1.2.840.113549.1.1.14',
    +3896         'SHA256withRSA':        '1.2.840.113549.1.1.11',
    +3897         'SHA384withRSA':        '1.2.840.113549.1.1.12',
    +3898         'SHA512withRSA':        '1.2.840.113549.1.1.13',
    +3899 
    +3900         'SHA1withECDSA':        '1.2.840.10045.4.1',
    +3901         'SHA224withECDSA':      '1.2.840.10045.4.3.1',
    +3902         'SHA256withECDSA':      '1.2.840.10045.4.3.2',
    +3903         'SHA384withECDSA':      '1.2.840.10045.4.3.3',
    +3904         'SHA512withECDSA':      '1.2.840.10045.4.3.4',
     3905 
    -3906         'des-EDE3-CBC':         '1.2.840.113549.3.7',
    -3907 
    -3908         'data':                 '1.2.840.113549.1.7.1', // CMS data
    -3909         'signed-data':          '1.2.840.113549.1.7.2', // CMS signed-data
    -3910         'enveloped-data':       '1.2.840.113549.1.7.3', // CMS enveloped-data
    -3911         'digested-data':        '1.2.840.113549.1.7.5', // CMS digested-data
    -3912         'encrypted-data':       '1.2.840.113549.1.7.6', // CMS encrypted-data
    -3913         'authenticated-data':   '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data
    -3914         'tstinfo':              '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo
    -3915 	'signingCertificate':	'1.2.840.113549.1.9.16.2.12',// SMIME
    -3916 	'timeStampToken':	'1.2.840.113549.1.9.16.2.14',// sigTS
    -3917 	'signaturePolicyIdentifier':	'1.2.840.113549.1.9.16.2.15',// cades
    -3918 	'etsArchiveTimeStamp':	'1.2.840.113549.1.9.16.2.27',// SMIME
    -3919 	'signingCertificateV2':	'1.2.840.113549.1.9.16.2.47',// SMIME
    -3920 	'etsArchiveTimeStampV2':'1.2.840.113549.1.9.16.2.48',// SMIME
    -3921         'extensionRequest':     '1.2.840.113549.1.9.14',// CSR extensionRequest
    -3922 	'contentType':		'1.2.840.113549.1.9.3',//PKCS#9
    -3923 	'messageDigest':	'1.2.840.113549.1.9.4',//PKCS#9
    -3924 	'signingTime':		'1.2.840.113549.1.9.5',//PKCS#9
    -3925 	'counterSignature':	'1.2.840.113549.1.9.6',//PKCS#9
    -3926 	'archiveTimeStampV3':	'0.4.0.1733.2.4',//ETSI EN29319122/TS101733
    -3927 	'pdfRevocationInfoArchival':'1.2.840.113583.1.1.8'//Adobe
    -3928     };
    -3929 
    -3930     this.objCache = {};
    -3931 
    -3932     /**
    -3933      * get DERObjectIdentifier by registered OID name
    -3934      * @name name2obj
    -3935      * @memberOf KJUR.asn1.x509.OID
    -3936      * @function
    -3937      * @param {String} name OID
    -3938      * @description
    -3939      * @example
    -3940      * var asn1ObjOID = OID.name2obj('SHA1withRSA');
    -3941      */
    -3942     this.name2obj = function(name) {
    -3943         if (typeof this.objCache[name] != "undefined")
    -3944             return this.objCache[name];
    -3945         if (typeof this.name2oidList[name] == "undefined")
    -3946             throw "Name of ObjectIdentifier not defined: " + name;
    -3947         var oid = this.name2oidList[name];
    -3948         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    -3949         this.objCache[name] = obj;
    -3950         return obj;
    -3951     };
    -3952 
    -3953     /**
    -3954      * get DERObjectIdentifier by registered attribute type name such like 'C' or 'CN'<br/>
    -3955      * @name atype2obj
    -3956      * @memberOf KJUR.asn1.x509.OID
    -3957      * @function
    -3958      * @param {String} atype short attribute type name such like 'C' or 'CN'
    -3959      * @description
    -3960      * @example
    -3961      * KJUR.asn1.x509.OID.atype2obj('CN') → 2.5.4.3
    -3962      * KJUR.asn1.x509.OID.atype2obj('OU') → 2.5.4.11
    -3963      */
    -3964     this.atype2obj = function(atype) {
    -3965         if (typeof this.objCache[atype] != "undefined")
    -3966             return this.objCache[atype];
    -3967         if (typeof this.atype2oidList[atype] == "undefined")
    -3968             throw "AttributeType name undefined: " + atype;
    -3969         var oid = this.atype2oidList[atype];
    -3970         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    -3971         this.objCache[atype] = obj;
    -3972         return obj;
    -3973     };
    -3974 };
    -3975 
    -3976 /**
    -3977  * convert OID to name<br/>
    -3978  * @name oid2name
    -3979  * @memberOf KJUR.asn1.x509.OID
    -3980  * @function
    -3981  * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4)
    -3982  * @return {String} OID name if registered otherwise empty string
    -3983  * @since asn1x509 1.0.9
    -3984  * @description
    -3985  * This static method converts OID string to its name.
    -3986  * If OID is undefined then it returns empty string (i.e. '').
    -3987  * @example
    -3988  * KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1") → 'authorityInfoAccess'
    -3989  */
    -3990 KJUR.asn1.x509.OID.oid2name = function(oid) {
    -3991     var list = KJUR.asn1.x509.OID.name2oidList;
    -3992     for (var name in list) {
    -3993         if (list[name] == oid) return name;
    -3994     }
    -3995     return '';
    -3996 };
    -3997 
    -3998 /**
    -3999  * convert OID to AttributeType name<br/>
    -4000  * @name oid2atype
    -4001  * @memberOf KJUR.asn1.x509.OID
    -4002  * @function
    -4003  * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4)
    -4004  * @return {String} OID AttributeType name if registered otherwise oid
    -4005  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -4006  * @description
    -4007  * This static method converts OID string to its AttributeType name.
    -4008  * If OID is not defined in OID.atype2oidList associative array then it returns OID
    -4009  * specified as argument.
    -4010  * @example
    -4011  * KJUR.asn1.x509.OID.oid2atype("2.5.4.3") → CN
    -4012  * KJUR.asn1.x509.OID.oid2atype("1.3.6.1.4.1.311.60.2.1.3") → jurisdictionOfIncorporationC
    -4013  * KJUR.asn1.x509.OID.oid2atype("0.1.2.3.4") → 0.1.2.3.4 // unregistered OID
    -4014  */
    -4015 KJUR.asn1.x509.OID.oid2atype = function(oid) {
    -4016     var list = KJUR.asn1.x509.OID.atype2oidList;
    -4017     for (var atype in list) {
    -4018         if (list[atype] == oid) return atype;
    -4019     }
    -4020     return oid;
    -4021 };
    +3906         'dsa':                  '1.2.840.10040.4.1',
    +3907         'SHA1withDSA':          '1.2.840.10040.4.3',
    +3908         'SHA224withDSA':        '2.16.840.1.101.3.4.3.1',
    +3909         'SHA256withDSA':        '2.16.840.1.101.3.4.3.2',
    +3910 
    +3911         'rsaEncryption':        '1.2.840.113549.1.1.1',
    +3912 
    +3913 	// X.500 AttributeType defined in RFC 4514
    +3914         'commonName':			'2.5.4.3',
    +3915         'countryName':			'2.5.4.6',
    +3916         'localityName':			'2.5.4.7',
    +3917         'stateOrProvinceName':		'2.5.4.8',
    +3918         'streetAddress':		'2.5.4.9',
    +3919         'organizationName':		'2.5.4.10',
    +3920         'organizationalUnitName':	'2.5.4.11',
    +3921         'domainComponent':		'0.9.2342.19200300.100.1.25',
    +3922         'userId':			'0.9.2342.19200300.100.1.1',
    +3923 	// other AttributeType name string
    +3924 	'surname':			'2.5.4.4',
    +3925         'title':			'2.5.4.12',
    +3926 	'distinguishedName':		'2.5.4.49',
    +3927 	'emailAddress':			'1.2.840.113549.1.9.1',
    +3928 	// other AttributeType name string (no short name)
    +3929 	'description':			'2.5.4.13',
    +3930 	'businessCategory':		'2.5.4.15',
    +3931 	'postalCode':			'2.5.4.17',
    +3932 	'uniqueIdentifier':		'2.5.4.45',
    +3933 	'organizationIdentifier':	'2.5.4.97',
    +3934 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    +3935 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    +3936 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3',
    +3937 
    +3938         'subjectKeyIdentifier': '2.5.29.14',
    +3939         'keyUsage':             '2.5.29.15',
    +3940         'subjectAltName':       '2.5.29.17',
    +3941         'issuerAltName':        '2.5.29.18',
    +3942         'basicConstraints':     '2.5.29.19',
    +3943         'cRLNumber':     	'2.5.29.20',
    +3944         'cRLReason':     	'2.5.29.21',
    +3945         'nameConstraints':      '2.5.29.30',
    +3946         'cRLDistributionPoints':'2.5.29.31',
    +3947         'certificatePolicies':  '2.5.29.32',
    +3948         'anyPolicy':  		'2.5.29.32.0',
    +3949         'authorityKeyIdentifier':'2.5.29.35',
    +3950         'policyConstraints':    '2.5.29.36',
    +3951         'extKeyUsage':          '2.5.29.37',
    +3952         'authorityInfoAccess':  '1.3.6.1.5.5.7.1.1',
    +3953         'ocsp':                 '1.3.6.1.5.5.7.48.1',
    +3954         'ocspBasic':            '1.3.6.1.5.5.7.48.1.1',
    +3955         'ocspNonce':            '1.3.6.1.5.5.7.48.1.2',
    +3956         'ocspNoCheck':          '1.3.6.1.5.5.7.48.1.5',
    +3957         'caIssuers':            '1.3.6.1.5.5.7.48.2',
    +3958 
    +3959         'anyExtendedKeyUsage':  '2.5.29.37.0',
    +3960         'serverAuth':           '1.3.6.1.5.5.7.3.1',
    +3961         'clientAuth':           '1.3.6.1.5.5.7.3.2',
    +3962         'codeSigning':          '1.3.6.1.5.5.7.3.3',
    +3963         'emailProtection':      '1.3.6.1.5.5.7.3.4',
    +3964         'timeStamping':         '1.3.6.1.5.5.7.3.8',
    +3965         'ocspSigning':          '1.3.6.1.5.5.7.3.9',
    +3966 
    +3967         'ecPublicKey':          '1.2.840.10045.2.1',
    +3968         'secp256r1':            '1.2.840.10045.3.1.7',
    +3969         'secp256k1':            '1.3.132.0.10',
    +3970         'secp384r1':            '1.3.132.0.34',
    +3971 
    +3972         'pkcs5PBES2':           '1.2.840.113549.1.5.13',
    +3973         'pkcs5PBKDF2':          '1.2.840.113549.1.5.12',
    +3974 
    +3975         'des-EDE3-CBC':         '1.2.840.113549.3.7',
    +3976 
    +3977         'data':                 '1.2.840.113549.1.7.1', // CMS data
    +3978         'signed-data':          '1.2.840.113549.1.7.2', // CMS signed-data
    +3979         'enveloped-data':       '1.2.840.113549.1.7.3', // CMS enveloped-data
    +3980         'digested-data':        '1.2.840.113549.1.7.5', // CMS digested-data
    +3981         'encrypted-data':       '1.2.840.113549.1.7.6', // CMS encrypted-data
    +3982         'authenticated-data':   '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data
    +3983         'tstinfo':              '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo
    +3984 	'signingCertificate':	'1.2.840.113549.1.9.16.2.12',// SMIME
    +3985 	'timeStampToken':	'1.2.840.113549.1.9.16.2.14',// sigTS
    +3986 	'signaturePolicyIdentifier':	'1.2.840.113549.1.9.16.2.15',// cades
    +3987 	'etsArchiveTimeStamp':	'1.2.840.113549.1.9.16.2.27',// SMIME
    +3988 	'signingCertificateV2':	'1.2.840.113549.1.9.16.2.47',// SMIME
    +3989 	'etsArchiveTimeStampV2':'1.2.840.113549.1.9.16.2.48',// SMIME
    +3990         'extensionRequest':     '1.2.840.113549.1.9.14',// CSR extensionRequest
    +3991 	'contentType':		'1.2.840.113549.1.9.3',//PKCS#9
    +3992 	'messageDigest':	'1.2.840.113549.1.9.4',//PKCS#9
    +3993 	'signingTime':		'1.2.840.113549.1.9.5',//PKCS#9
    +3994 	'counterSignature':	'1.2.840.113549.1.9.6',//PKCS#9
    +3995 	'archiveTimeStampV3':	'0.4.0.1733.2.4',//ETSI EN29319122/TS101733
    +3996 	'pdfRevocationInfoArchival':'1.2.840.113583.1.1.8', //Adobe
    +3997 	'adobeTimeStamp':	'1.2.840.113583.1.1.9.1' // Adobe
    +3998     };
    +3999 
    +4000     this.objCache = {};
    +4001 
    +4002     /**
    +4003      * get DERObjectIdentifier by registered OID name
    +4004      * @name name2obj
    +4005      * @memberOf KJUR.asn1.x509.OID
    +4006      * @function
    +4007      * @param {String} name OID
    +4008      * @description
    +4009      * @example
    +4010      * var asn1ObjOID = OID.name2obj('SHA1withRSA');
    +4011      */
    +4012     this.name2obj = function(name) {
    +4013         if (typeof this.objCache[name] != "undefined")
    +4014             return this.objCache[name];
    +4015         if (typeof this.name2oidList[name] == "undefined")
    +4016             throw "Name of ObjectIdentifier not defined: " + name;
    +4017         var oid = this.name2oidList[name];
    +4018         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    +4019         this.objCache[name] = obj;
    +4020         return obj;
    +4021     };
     4022 
    -4023 /**
    -4024  * convert OID name to OID value<br/>
    -4025  * @name name2oid
    -4026  * @memberOf KJUR.asn1.x509.OID
    -4027  * @function
    -4028  * @param {String} name OID name or OID (ex. "sha1" or "1.2.3.4")
    -4029  * @return {String} dot noted Object Identifer string (ex. 1.2.3.4)
    -4030  * @since asn1x509 1.0.11
    -4031  * @description
    -4032  * This static method converts from OID name to OID string.
    -4033  * If OID is undefined then it returns empty string (i.e. '').
    -4034  * @example
    -4035  * KJUR.asn1.x509.OID.name2oid("authorityInfoAccess") → "1.3.6.1.5.5.7.1.1"
    -4036  * KJUR.asn1.x509.OID.name2oid("1.2.3.4") → "1.2.3.4"
    -4037  * KJUR.asn1.x509.OID.name2oid("UNKNOWN NAME") → ""
    -4038  */
    -4039 KJUR.asn1.x509.OID.name2oid = function(name) {
    -4040     if (name.match(/^[0-9.]+$/)) return name;
    -4041     var list = KJUR.asn1.x509.OID.name2oidList;
    -4042     if (list[name] === undefined) return '';
    -4043     return list[name];
    +4023     /**
    +4024      * get DERObjectIdentifier by registered attribute type name such like 'C' or 'CN'<br/>
    +4025      * @name atype2obj
    +4026      * @memberOf KJUR.asn1.x509.OID
    +4027      * @function
    +4028      * @param {String} atype short attribute type name such like 'C' or 'CN'
    +4029      * @description
    +4030      * @example
    +4031      * KJUR.asn1.x509.OID.atype2obj('CN') → 2.5.4.3
    +4032      * KJUR.asn1.x509.OID.atype2obj('OU') → 2.5.4.11
    +4033      */
    +4034     this.atype2obj = function(atype) {
    +4035         if (typeof this.objCache[atype] != "undefined")
    +4036             return this.objCache[atype];
    +4037         if (typeof this.atype2oidList[atype] == "undefined")
    +4038             throw "AttributeType name undefined: " + atype;
    +4039         var oid = this.atype2oidList[atype];
    +4040         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    +4041         this.objCache[atype] = obj;
    +4042         return obj;
    +4043     };
     4044 };
     4045 
     4046 /**
    -4047  * X.509 certificate and CRL utilities class<br/>
    -4048  * @name KJUR.asn1.x509.X509Util
    -4049  * @class X.509 certificate and CRL utilities class
    -4050  */
    -4051 KJUR.asn1.x509.X509Util = {};
    -4052 
    -4053 /**
    -4054  * issue a certificate in PEM format (DEPRECATED)
    -4055  * @name newCertPEM
    -4056  * @memberOf KJUR.asn1.x509.X509Util
    -4057  * @function
    -4058  * @param {Array} param JSON object of parameter to issue a certificate
    -4059  * @since asn1x509 1.0.6
    -4060  * @deprecated since jsrsasign 9.0.0 asn1x509 2.0.0. please move to {@link KJUR.asn1.x509.Certificate} constructor
    -4061  * @description
    -4062  * This method can issue a certificate by a simple
    -4063  * JSON object.
    -4064  * Signature value will be provided by signing with
    -4065  * private key using 'cakey' parameter or
    -4066  * hexadecimal signature value by 'sighex' parameter.
    -4067  * <br/>
    -4068  * NOTE: Algorithm parameter of AlgorithmIdentifier will
    -4069  * be set automatically by default. 
    -4070  * (see {@link KJUR.asn1.x509.AlgorithmIdentifier})
    -4071  * from jsrsasign 7.1.1 asn1x509 1.0.20.
    -4072  * <br/>
    -4073  * NOTE2: 
    -4074  * RSA-PSS algorithm has been supported from jsrsasign 8.0.21.
    -4075  * As for RSA-PSS signature algorithm names and signing parameters 
    -4076  * such as MGF function and salt length, please see
    -4077  * {@link KJUR.asn1.x509.AlgorithmIdentifier} class.
    -4078  *
    -4079  * @example
    -4080  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -4081  *   serial: {int: 4},
    -4082  *   sigalg: {name: 'SHA1withECDSA'},
    -4083  *   issuer: {str: '/C=US/O=a'},
    -4084  *   notbefore: {'str': '130504235959Z'},
    -4085  *   notafter: {'str': '140504235959Z'},
    -4086  *   subject: {str: '/C=US/O=b'},
    -4087  *   sbjpubkey: pubKeyObj,
    -4088  *   ext: [
    -4089  *     {basicConstraints: {cA: true, critical: true}},
    -4090  *     {keyUsage: {bin: '11'}},
    -4091  *   ],
    -4092  *   cakey: prvKeyObj
    -4093  * });
    -4094  * // -- or --
    -4095  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -4096  *   serial: {int: 4},
    -4097  *   sigalg: {name: 'SHA1withECDSA'},
    -4098  *   issuer: {str: '/C=US/O=a'},
    -4099  *   notbefore: {'str': '130504235959Z'},
    -4100  *   notafter: {'str': '140504235959Z'},
    -4101  *   subject: {str: '/C=US/O=b'},
    -4102  *   sbjpubkey: pubKeyPEM,
    -4103  *   ext: [
    -4104  *     {basicConstraints: {cA: true, critical: true}},
    -4105  *     {keyUsage: {bin: '11'}},
    -4106  *   ],
    -4107  *   cakey: [prvkey, pass]}
    -4108  * );
    -4109  * // -- or --
    -4110  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -4111  *   serial: {int: 1},
    -4112  *   sigalg: {name: 'SHA1withRSA'},
    -4113  *   issuer: {str: '/C=US/O=T1'},
    -4114  *   notbefore: {'str': '130504235959Z'},
    -4115  *   notafter: {'str': '140504235959Z'},
    -4116  *   subject: {str: '/C=US/O=T1'},
    -4117  *   sbjpubkey: pubKeyObj,
    -4118  *   sighex: '0102030405..'
    -4119  * });
    -4120  * // for the issuer and subject field, another
    -4121  * // representation is also available
    -4122  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -4123  *   serial: {int: 1},
    -4124  *   sigalg: {name: 'SHA256withRSA'},
    -4125  *   issuer: {C: "US", O: "T1"},
    -4126  *   notbefore: {'str': '130504235959Z'},
    -4127  *   notafter: {'str': '140504235959Z'},
    -4128  *   subject: {C: "US", O: "T1", CN: "http://example.com/"},
    -4129  *   sbjpubkey: pubKeyObj,
    -4130  *   sighex: '0102030405..'
    -4131  * });
    -4132  */
    -4133 KJUR.asn1.x509.X509Util.newCertPEM = function(param) {
    -4134     var _KJUR_asn1_x509 = KJUR.asn1.x509,
    -4135 	_TBSCertificate = _KJUR_asn1_x509.TBSCertificate,
    -4136 	_Certificate = _KJUR_asn1_x509.Certificate;
    -4137     var cert = new _Certificate(param);
    -4138     return cert.getPEM();
    -4139 };
    -4140 
    -4141 
    \ No newline at end of file +4047 * convert OID to name<br/> +4048 * @name oid2name +4049 * @memberOf KJUR.asn1.x509.OID +4050 * @function +4051 * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4) +4052 * @return {String} OID name if registered otherwise empty string +4053 * @since asn1x509 1.0.9 +4054 * @description +4055 * This static method converts OID string to its name. +4056 * If OID is undefined then it returns empty string (i.e. ''). +4057 * @example +4058 * KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1") → 'authorityInfoAccess' +4059 */
    +4060 KJUR.asn1.x509.OID.oid2name = function(oid) { +4061 var list = KJUR.asn1.x509.OID.name2oidList; +4062 for (var name in list) { +4063 if (list[name] == oid) return name; +4064 } +4065 return ''; +4066 }; +4067 +4068 /** +4069 * convert OID to AttributeType name<br/> +4070 * @name oid2atype +4071 * @memberOf KJUR.asn1.x509.OID +4072 * @function +4073 * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4) +4074 * @return {String} OID AttributeType name if registered otherwise oid +4075 * @since jsrsasign 6.2.2 asn1x509 1.0.18 +4076 * @description +4077 * This static method converts OID string to its AttributeType name. +4078 * If OID is not defined in OID.atype2oidList associative array then it returns OID +4079 * specified as argument. +4080 * @example +4081 * KJUR.asn1.x509.OID.oid2atype("2.5.4.3") → CN +4082 * KJUR.asn1.x509.OID.oid2atype("1.3.6.1.4.1.311.60.2.1.3") → jurisdictionOfIncorporationC +4083 * KJUR.asn1.x509.OID.oid2atype("0.1.2.3.4") → 0.1.2.3.4 // unregistered OID +4084 */ +4085 KJUR.asn1.x509.OID.oid2atype = function(oid) { +4086 var list = KJUR.asn1.x509.OID.atype2oidList; +4087 for (var atype in list) { +4088 if (list[atype] == oid) return atype; +4089 } +4090 return oid; +4091 }; +4092 +4093 /** +4094 * convert OID name to OID value<br/> +4095 * @name name2oid +4096 * @memberOf KJUR.asn1.x509.OID +4097 * @function +4098 * @param {String} name OID name or OID (ex. "sha1" or "1.2.3.4") +4099 * @return {String} dot noted Object Identifer string (ex. 1.2.3.4) +4100 * @since asn1x509 1.0.11 +4101 * @description +4102 * This static method converts from OID name to OID string. +4103 * If OID is undefined then it returns empty string (i.e. ''). +4104 * @example +4105 * KJUR.asn1.x509.OID.name2oid("authorityInfoAccess") → "1.3.6.1.5.5.7.1.1" +4106 * KJUR.asn1.x509.OID.name2oid("1.2.3.4") → "1.2.3.4" +4107 * KJUR.asn1.x509.OID.name2oid("UNKNOWN NAME") → "" +4108 */ +4109 KJUR.asn1.x509.OID.name2oid = function(name) { +4110 if (name.match(/^[0-9.]+$/)) return name; +4111 var list = KJUR.asn1.x509.OID.name2oidList; +4112 if (list[name] === undefined) return ''; +4113 return list[name]; +4114 }; +4115 +4116 /** +4117 * X.509 certificate and CRL utilities class<br/> +4118 * @name KJUR.asn1.x509.X509Util +4119 * @class X.509 certificate and CRL utilities class +4120 */ +4121 KJUR.asn1.x509.X509Util = {}; +4122 +4123 /** +4124 * issue a certificate in PEM format (DEPRECATED) +4125 * @name newCertPEM +4126 * @memberOf KJUR.asn1.x509.X509Util +4127 * @function +4128 * @param {Array} param JSON object of parameter to issue a certificate +4129 * @since asn1x509 1.0.6 +4130 * @deprecated since jsrsasign 9.0.0 asn1x509 2.0.0. please move to {@link KJUR.asn1.x509.Certificate} constructor +4131 * @description +4132 * This method can issue a certificate by a simple +4133 * JSON object. +4134 * Signature value will be provided by signing with +4135 * private key using 'cakey' parameter or +4136 * hexadecimal signature value by 'sighex' parameter. +4137 * <br/> +4138 * NOTE: Algorithm parameter of AlgorithmIdentifier will +4139 * be set automatically by default. +4140 * (see {@link KJUR.asn1.x509.AlgorithmIdentifier}) +4141 * from jsrsasign 7.1.1 asn1x509 1.0.20. +4142 * <br/> +4143 * NOTE2: +4144 * RSA-PSS algorithm has been supported from jsrsasign 8.0.21. +4145 * As for RSA-PSS signature algorithm names and signing parameters +4146 * such as MGF function and salt length, please see +4147 * {@link KJUR.asn1.x509.AlgorithmIdentifier} class. +4148 * +4149 * @example +4150 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +4151 * serial: {int: 4}, +4152 * sigalg: {name: 'SHA1withECDSA'}, +4153 * issuer: {str: '/C=US/O=a'}, +4154 * notbefore: {'str': '130504235959Z'}, +4155 * notafter: {'str': '140504235959Z'}, +4156 * subject: {str: '/C=US/O=b'}, +4157 * sbjpubkey: pubKeyObj, +4158 * ext: [ +4159 * {basicConstraints: {cA: true, critical: true}}, +4160 * {keyUsage: {bin: '11'}}, +4161 * ], +4162 * cakey: prvKeyObj +4163 * }); +4164 * // -- or -- +4165 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +4166 * serial: {int: 4}, +4167 * sigalg: {name: 'SHA1withECDSA'}, +4168 * issuer: {str: '/C=US/O=a'}, +4169 * notbefore: {'str': '130504235959Z'}, +4170 * notafter: {'str': '140504235959Z'}, +4171 * subject: {str: '/C=US/O=b'}, +4172 * sbjpubkey: pubKeyPEM, +4173 * ext: [ +4174 * {basicConstraints: {cA: true, critical: true}}, +4175 * {keyUsage: {bin: '11'}}, +4176 * ], +4177 * cakey: [prvkey, pass]} +4178 * ); +4179 * // -- or -- +4180 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +4181 * serial: {int: 1}, +4182 * sigalg: {name: 'SHA1withRSA'}, +4183 * issuer: {str: '/C=US/O=T1'}, +4184 * notbefore: {'str': '130504235959Z'}, +4185 * notafter: {'str': '140504235959Z'}, +4186 * subject: {str: '/C=US/O=T1'}, +4187 * sbjpubkey: pubKeyObj, +4188 * sighex: '0102030405..' +4189 * }); +4190 * // for the issuer and subject field, another +4191 * // representation is also available +4192 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +4193 * serial: {int: 1}, +4194 * sigalg: {name: 'SHA256withRSA'}, +4195 * issuer: {C: "US", O: "T1"}, +4196 * notbefore: {'str': '130504235959Z'}, +4197 * notafter: {'str': '140504235959Z'}, +4198 * subject: {C: "US", O: "T1", CN: "http://example.com/"}, +4199 * sbjpubkey: pubKeyObj, +4200 * sighex: '0102030405..' +4201 * }); +4202 */ +4203 KJUR.asn1.x509.X509Util.newCertPEM = function(param) { +4204 var _KJUR_asn1_x509 = KJUR.asn1.x509, +4205 _TBSCertificate = _KJUR_asn1_x509.TBSCertificate, +4206 _Certificate = _KJUR_asn1_x509.Certificate; +4207 var cert = new _Certificate(param); +4208 return cert.getPEM(); +4209 }; +4210 +4211
    \ No newline at end of file diff --git a/api/symbols/src/x509-1.1.js.html b/api/symbols/src/x509-1.1.js.html index dadc7084..a245d32c 100644 --- a/api/symbols/src/x509-1.1.js.html +++ b/api/symbols/src/x509-1.1.js.html @@ -5,7 +5,7 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 /* x509-2.0.4.js (c) 2012-2020 Kenji Urushima | kjur.github.io/jsrsasign/license
    +	
      1 /* x509-2.0.5.js (c) 2012-2020 Kenji Urushima | kjur.github.io/jsrsasign/license
       2  */
       3 /*
       4  * x509.js - X509 class to read subject public key from certificate.
    @@ -23,7 +23,7 @@
      16  * @fileOverview
      17  * @name x509-1.1.js
      18  * @author Kenji Urushima kenji.urushima@gmail.com
    - 19  * @version jsrsasign 10.0.0 x509 2.0.4 (2020-Sep-22)
    + 19  * @version jsrsasign 10.0.1 x509 2.0.5 (2020-Oct-11)
      20  * @since jsrsasign 1.x.x
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -1945,772 +1945,834 @@
     1938 	return result;
     1939     };
     1940 
    -1941     // ===== BEGIN X500Name related =====================================
    -1942 
    -1943     this.getX500NameRule = function(aDN) {
    -1944 	var isPRNRule = true;
    -1945 	var isUTF8Rule = true;
    -1946 	var isMixedRule = false;
    -1947 	var logfull = "";
    -1948 	var logcheck = "";
    -1949 	var lasttag = null;
    -1950 
    -1951 	var a = [];
    -1952 	for (var i = 0; i < aDN.length; i++) {
    -1953 	    var aRDN = aDN[i];
    -1954 	    for (var j = 0; j < aRDN.length; j++) {
    -1955 		a.push(aRDN[j]);
    -1956 	    }
    -1957 	}
    -1958 
    -1959 	for (var i = 0; i < a.length; i++) {
    -1960 	    var item = a[i];
    -1961 	    var tag = item.ds;
    -1962 	    var value = item.value;
    -1963 	    var type = item.type;
    -1964 	    logfull += ":" + tag;
    -1965 	    
    -1966 	    if (tag != "prn" && tag != "utf8" && tag != "ia5") {
    -1967 		return "mixed";
    -1968 	    }
    -1969 	    if (tag == "ia5") {
    -1970 		if (type != "CN") {
    -1971 		    return "mixed";
    -1972 		} else {
    -1973 		    if (! KJUR.lang.String.isMail(value)) {
    -1974 			return "mixed";
    -1975 		    } else {
    -1976 			continue;
    -1977 		    }
    -1978 		}
    -1979 	    }
    -1980 	    if (type == "C") {
    -1981 		if (tag == "prn") {
    -1982 		    continue;
    -1983 		} else {
    -1984 		    return "mixed";
    -1985 		}
    -1986 	    }
    -1987 	    logcheck += ":" + tag;
    -1988 	    if (lasttag == null) {
    -1989 		lasttag = tag;
    -1990 	    } else {
    -1991 		if (lasttag !== tag) return "mixed";
    -1992 	    }
    -1993 	}
    -1994 	if (lasttag == null) {
    -1995 	    return "prn";
    -1996 	} else {
    -1997 	    return lasttag;
    -1998 	}
    +1941     /**
    +1942      * parse AdobeTimeStamp extension as JSON object<br/>
    +1943      * @name getExtAdobeTimeStamp
    +1944      * @memberOf X509#
    +1945      * @function
    +1946      * @param {String} hExtV hexadecimal string of extension value
    +1947      * @param {Boolean} critical flag
    +1948      * @return {Array} JSON object of parsed AdobeTimeStamp extension
    +1949      * @since jsrsasign 10.0.1 x509 2.0.5
    +1950      * @see {@link KJUR.asn1.x509.AdobeTimeStamp}
    +1951      * @see {@link X509#getExtParamArray}
    +1952      * @see {@link X509#getExtParam}
    +1953      * @description
    +1954      * This method parses
    +1955      * X.509v3 AdobeTimeStamp private extension value defined in the
    +1956      * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSigDC/oids.html">
    +1957      * Adobe site</a> as JSON object.
    +1958      * This extension provides the URL location for time stamp service.
    +1959      * <pre>
    +1960      * adbe- OBJECT IDENTIFIER ::=  { adbe(1.2.840.113583) acrobat(1) security(1) x509Ext(9) 1 }
    +1961      *  ::= SEQUENCE {
    +1962      *     version INTEGER  { v1(1) }, -- extension version
    +1963      *     location GeneralName (In v1 GeneralName can be only uniformResourceIdentifier)
    +1964      *     requiresAuth        boolean (default false), OPTIONAL }
    +1965      * </pre>
    +1966      * <br/>
    +1967      * Result of this method can be passed to 
    +1968      * {@link KJUR.asn1.x509.AdobeTimeStamp} constructor.
    +1969      * @example
    +1970      * x.getExtAdobeTimeStamp(<<extn hex value >>) →
    +1971      * { extname: "adobeTimeStamp", uri: "http://tsa.example.com/" reqauth: true }
    +1972      */
    +1973     this.getExtAdobeTimeStamp = function(hExtV, critical) {
    +1974 	if (hExtV === undefined && critical === undefined) {
    +1975 	    var info = this.getExtInfo("adobeTimeStamp");
    +1976 	    if (info === undefined) return undefined;
    +1977 	    hExtV = _getTLV(this.hex, info.vidx);
    +1978 	    critical = info.critical;
    +1979 	}
    +1980 
    +1981 	var result = {extname:"adobeTimeStamp"};
    +1982 	if (critical) result.critical = true;
    +1983 
    +1984 	var a = _getChildIdx(hExtV, 0);
    +1985 	if (a.length > 1) {
    +1986 	    var hGN = _getTLV(hExtV, a[1])
    +1987 	    var gnParam = this.getGeneraName(hGN);
    +1988 	    if (gnParam.uri != undefined) {
    +1989 		result.uri = gnParam.uri;
    +1990 	    }
    +1991 	}
    +1992 	if (a.length > 2) {
    +1993 	    var hBool = _getTLV(hExtV, a[2]);
    +1994 	    if (hBool == "0101ff") result.reqauth = true;
    +1995 	    if (hBool == "010100") result.reqauth = false;
    +1996 	}
    +1997 
    +1998 	return result;
     1999     };
     2000 
    -2001     /**
    -2002      * get Name ASN.1 structure parameter array<br/>
    -2003      * @name getX500Name
    -2004      * @memberOf X509#
    -2005      * @function
    -2006      * @param {String} h hexadecimal string of Name
    -2007      * @return {Array} array of RDN parameter array
    -2008      * @since jsrsasign 9.0.0 x509 2.0.0
    -2009      * @see {@link X509#getX500Name}
    -2010      * @see {@link X509#getRDN}
    -2011      * @see {@link X509#getAttrTypeAndValue}
    -2012      * @description
    -2013      * This method will get Name parameter defined in
    -2014      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    -2015      * RFC 5280 4.1.2.4</a>.
    -2016      * <pre>
    -2017      * Name ::= CHOICE { -- only one possibility for now --
    -2018      *   rdnSequence  RDNSequence }
    -2019      * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    -2020      * </pre>
    -2021      * @example
    -2022      * x = new X509();
    -2023      * x.getX500Name("30...") →
    -2024      * [[{type:"C",value:"US",ds:"prn"}],
    -2025      *  [{type:"O",value:"Sample Corp.",ds:"utf8"}],
    -2026      *  [{type:"CN",value:"john.smith@example.com",ds:"ia5"}]]
    -2027      */
    -2028     this.getX500Name = function(h) {
    -2029 	var result = [];
    -2030 	var a = _getChildIdx(h, 0);
    -2031 	for (var i = 0; i < a.length; i++) {
    -2032 	    result.push(this.getRDN(_getTLV(h, a[i])));
    -2033 	}
    -2034 	return result;
    -2035     };
    -2036     
    -2037     /**
    -2038      * get RelativeDistinguishedName ASN.1 structure parameter array<br/>
    -2039      * @name getRDN
    -2040      * @memberOf X509#
    -2041      * @function
    -2042      * @param {String} h hexadecimal string of RDN
    -2043      * @return {Array} array of AttrTypeAndValue parameters
    -2044      * @since jsrsasign 9.0.0 x509 2.0.0
    -2045      * @see {@link X509#getX500Name}
    -2046      * @see {@link X509#getRDN}
    -2047      * @see {@link X509#getAttrTypeAndValue}
    -2048      * @description
    -2049      * This method will get RelativeDistinguishedName parameters defined in
    -2050      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    -2051      * RFC 5280 4.1.2.4</a>.
    -2052      * <pre>
    -2053      * RelativeDistinguishedName ::=
    -2054      *   SET SIZE (1..MAX) OF AttributeTypeAndValue
    -2055      * </pre>
    -2056      * @example
    -2057      * x = new X509();
    -2058      * x.getRDN("31...") →
    -2059      * [{type:"C",value:"US",ds:"prn"}] or
    -2060      * [{type:"O",value:"Sample Corp.",ds:"prn"}] or
    -2061      * [{type:"CN",value:"john.smith@example.com",ds:"ia5"}]
    -2062      */
    -2063     this.getRDN = function(h) {
    -2064 	var result = [];
    -2065 	var a = _getChildIdx(h, 0);
    -2066 	for (var i = 0; i < a.length; i++) {
    -2067 	    result.push(this.getAttrTypeAndValue(_getTLV(h, a[i])));
    -2068 	}
    -2069 	return result;
    -2070     };
    -2071 
    -2072     /**
    -2073      * get AttributeTypeAndValue ASN.1 structure parameter as JSON object<br/>
    -2074      * @name getAttrTypeAndValue
    -2075      * @memberOf X509#
    -2076      * @function
    -2077      * @param {String} h hexadecimal string of AttributeTypeAndValue
    -2078      * @return {Object} JSON object of AttributeTypeAndValue parameters
    -2079      * @since jsrsasign 9.0.0 x509 2.0.0
    -2080      * @see {@link X509#getX500Name}
    -2081      * @see {@link X509#getRDN}
    -2082      * @description
    -2083      * This method will get AttributeTypeAndValue parameters defined in
    -2084      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    -2085      * RFC 5280 4.1.2.4</a>.
    -2086      * <pre>
    -2087      * AttributeTypeAndValue ::= SEQUENCE {
    -2088      *   type     AttributeType,
    -2089      *   value    AttributeValue }
    -2090      * AttributeType ::= OBJECT IDENTIFIER
    -2091      * AttributeValue ::= ANY -- DEFINED BY AttributeType
    -2092      * </pre>
    -2093      * <ul>
    -2094      * <li>{String}type - AttributeType name or OID(ex. C,O,CN)</li>
    -2095      * <li>{String}value - raw string of ASN.1 value of AttributeValue</li>
    -2096      * <li>{String}ds - DirectoryString type of AttributeValue</li>
    -2097      * </ul>
    -2098      * "ds" has one of following value:
    -2099      * <ul>
    -2100      * <li>utf8 - (0x0c) UTF8String</li>
    -2101      * <li>prn  - (0x13) PrintableString</li>
    -2102      * <li>ia5  - (0x16) IA5String</li>
    -2103      * <li>vis  - (0x1a) VisibleString</li>
    -2104      * <li>bmp  - (0x1e) BMPString</li>
    -2105      * </ul>
    -2106      * @example
    -2107      * x = new X509();
    -2108      * x.getAttrTypeAndValue("30...") →
    -2109      * {type:"CN",value:"john.smith@example.com",ds:"ia5"} or
    -2110      * {type:"O",value:"Sample Corp.",ds:"prn"}
    -2111      */
    -2112     // tel  - (0x14) TeletexString ... for future
    -2113     // num  - (0x12) NumericString ... for future
    -2114     // unv  - (0x1c??) UniversalString ... for future
    -2115     this.getAttrTypeAndValue = function(h) {
    -2116 	var result = {type: null, value: null, ds: null};
    -2117 	var a = _getChildIdx(h, 0);
    -2118 	var hOID = _getVbyList(h, a[0], [], "06");
    -2119 	var hValue = _getVbyList(h, a[1], []);
    -2120 	var oid = KJUR.asn1.ASN1Util.oidHexToInt(hOID);
    -2121 	result.type = KJUR.asn1.x509.OID.oid2atype(oid);
    -2122 	result.value = hextorstr(hValue);
    -2123 	result.ds = this.HEX2STAG[h.substr(a[1], 2)];
    -2124 	return result;
    -2125     };
    -2126 
    -2127     // ===== END X500Name related =====================================
    -2128 
    -2129     // ===== BEGIN read certificate =====================================
    -2130     /**
    -2131      * read PEM formatted X.509 certificate from string.<br/>
    -2132      * @name readCertPEM
    -2133      * @memberOf X509#
    -2134      * @function
    -2135      * @param {String} sCertPEM string for PEM formatted X.509 certificate
    -2136      * @example
    -2137      * x = new X509();
    -2138      * x.readCertPEM(sCertPEM); // read certificate
    -2139      */
    -2140     this.readCertPEM = function(sCertPEM) {
    -2141         this.readCertHex(_pemtohex(sCertPEM));
    -2142     };
    -2143 
    -2144     /**
    -2145      * read a hexadecimal string of X.509 certificate<br/>
    -2146      * @name readCertHex
    -2147      * @memberOf X509#
    -2148      * @function
    -2149      * @param {String} sCertHex hexadecimal string of X.509 certificate
    -2150      * @since jsrsasign 7.1.4 x509 1.1.13
    -2151      * @description
    -2152      * NOTE: {@link X509#parseExt} will called internally since jsrsasign 7.2.0.
    -2153      * @example
    -2154      * x = new X509();
    -2155      * x.readCertHex("3082..."); // read certificate
    -2156      */
    -2157     this.readCertHex = function(sCertHex) {
    -2158         this.hex = sCertHex;
    -2159 	this.getVersion(); // set version parameter
    -2160 
    -2161 	try {
    -2162 	    _getIdxbyList(this.hex, 0, [0, 7], "a3"); // has [3] v3ext
    -2163 	    this.parseExt();
    -2164 	} catch(ex) {};
    -2165     };
    -2166 
    -2167     // ===== END read certificate =====================================
    -2168 
    -2169     /**
    -2170      * get JSON object of certificate parameters<br/>
    -2171      * @name getParam
    -2172      * @memberOf X509#
    -2173      * @function
    -2174      * @return {Array} JSON object of certificate parameters
    -2175      * @since jsrsasign 9.0.0 x509 2.0.0
    -2176      * @see KJUR.asn1.x509.X509Util.newCertPEM
    -2177      * @description
    -2178      * This method returns a JSON object of the certificate
    -2179      * parameters. Return value can be passed to
    -2180      * {@link KJUR.asn1.x509.X509Util.newCertPEM}.
    -2181      * @example
    -2182      * x = new X509();
    -2183      * x.readCertPEM("-----BEGIN CERTIFICATE...");
    -2184      * x.getParam() →
    -2185      * {version:3,
    -2186      *  serial:{hex:"12ab"},
    -2187      *  sigalg:"SHA256withRSA",
    -2188      *  issuer: {array:[[{type:'CN',value:'CA1',ds:'prn'}]],str:"/O=CA1"},
    -2189      *  notbefore:"160403023700Z",
    -2190      *  notafter:"160702023700Z",
    -2191      *  subject: {array:[[{type:'CN',value:'Test1',ds:'prn'}]],str:"/CN=Test1"},
    -2192      *  sbjpubkey:"-----BEGIN PUBLIC KEY...",
    -2193      *  ext:[
    -2194      *   {extname:"keyUsage",critical:true,names:["digitalSignature"]},
    -2195      *   {extname:"basicConstraints",critical:true},
    -2196      *   {extname:"subjectKeyIdentifier",kid:{hex:"f2eb..."}},
    -2197      *   {extname:"authorityKeyIdentifier",kid:{hex:"12ab..."}},
    -2198      *   {extname:"authorityInfoAccess",array:[{ocsp:"http://ocsp.example.com/"}]},
    -2199      *   {extname:"certificatePolicies",array:[{policyoid:"2.23.140.1.2.1"}]}
    -2200      *  }],
    -2201      *  sighex:"0b76...8"
    -2202      * };
    -2203      */
    -2204     this.getParam = function() {
    -2205 	var result = {};
    -2206 	result.version = this.getVersion();
    -2207 	result.serial = {hex: this.getSerialNumberHex()};
    -2208 	result.sigalg = this.getSignatureAlgorithmField();
    -2209 	result.issuer = this.getIssuer();
    -2210 	result.notbefore = this.getNotBefore();
    -2211 	result.notafter = this.getNotAfter();
    -2212 	result.subject = this.getSubject();
    -2213 	result.sbjpubkey = hextopem(this.getPublicKeyHex(), "PUBLIC KEY");
    -2214 	if (this.aExtInfo.length > 0) {
    -2215 	    result.ext = this.getExtParamArray();
    -2216 	}
    -2217 	result.sighex = this.getSignatureValueHex();
    -2218 	return result;
    -2219     };
    +2001     // ===== BEGIN X500Name related =====================================
    +2002 
    +2003     this.getX500NameRule = function(aDN) {
    +2004 	var isPRNRule = true;
    +2005 	var isUTF8Rule = true;
    +2006 	var isMixedRule = false;
    +2007 	var logfull = "";
    +2008 	var logcheck = "";
    +2009 	var lasttag = null;
    +2010 
    +2011 	var a = [];
    +2012 	for (var i = 0; i < aDN.length; i++) {
    +2013 	    var aRDN = aDN[i];
    +2014 	    for (var j = 0; j < aRDN.length; j++) {
    +2015 		a.push(aRDN[j]);
    +2016 	    }
    +2017 	}
    +2018 
    +2019 	for (var i = 0; i < a.length; i++) {
    +2020 	    var item = a[i];
    +2021 	    var tag = item.ds;
    +2022 	    var value = item.value;
    +2023 	    var type = item.type;
    +2024 	    logfull += ":" + tag;
    +2025 	    
    +2026 	    if (tag != "prn" && tag != "utf8" && tag != "ia5") {
    +2027 		return "mixed";
    +2028 	    }
    +2029 	    if (tag == "ia5") {
    +2030 		if (type != "CN") {
    +2031 		    return "mixed";
    +2032 		} else {
    +2033 		    if (! KJUR.lang.String.isMail(value)) {
    +2034 			return "mixed";
    +2035 		    } else {
    +2036 			continue;
    +2037 		    }
    +2038 		}
    +2039 	    }
    +2040 	    if (type == "C") {
    +2041 		if (tag == "prn") {
    +2042 		    continue;
    +2043 		} else {
    +2044 		    return "mixed";
    +2045 		}
    +2046 	    }
    +2047 	    logcheck += ":" + tag;
    +2048 	    if (lasttag == null) {
    +2049 		lasttag = tag;
    +2050 	    } else {
    +2051 		if (lasttag !== tag) return "mixed";
    +2052 	    }
    +2053 	}
    +2054 	if (lasttag == null) {
    +2055 	    return "prn";
    +2056 	} else {
    +2057 	    return lasttag;
    +2058 	}
    +2059     };
    +2060 
    +2061     /**
    +2062      * get Name ASN.1 structure parameter array<br/>
    +2063      * @name getX500Name
    +2064      * @memberOf X509#
    +2065      * @function
    +2066      * @param {String} h hexadecimal string of Name
    +2067      * @return {Array} array of RDN parameter array
    +2068      * @since jsrsasign 9.0.0 x509 2.0.0
    +2069      * @see {@link X509#getX500Name}
    +2070      * @see {@link X509#getRDN}
    +2071      * @see {@link X509#getAttrTypeAndValue}
    +2072      * @description
    +2073      * This method will get Name parameter defined in
    +2074      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    +2075      * RFC 5280 4.1.2.4</a>.
    +2076      * <pre>
    +2077      * Name ::= CHOICE { -- only one possibility for now --
    +2078      *   rdnSequence  RDNSequence }
    +2079      * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    +2080      * </pre>
    +2081      * @example
    +2082      * x = new X509();
    +2083      * x.getX500Name("30...") →
    +2084      * [[{type:"C",value:"US",ds:"prn"}],
    +2085      *  [{type:"O",value:"Sample Corp.",ds:"utf8"}],
    +2086      *  [{type:"CN",value:"john.smith@example.com",ds:"ia5"}]]
    +2087      */
    +2088     this.getX500Name = function(h) {
    +2089 	var result = [];
    +2090 	var a = _getChildIdx(h, 0);
    +2091 	for (var i = 0; i < a.length; i++) {
    +2092 	    result.push(this.getRDN(_getTLV(h, a[i])));
    +2093 	}
    +2094 	return result;
    +2095     };
    +2096     
    +2097     /**
    +2098      * get RelativeDistinguishedName ASN.1 structure parameter array<br/>
    +2099      * @name getRDN
    +2100      * @memberOf X509#
    +2101      * @function
    +2102      * @param {String} h hexadecimal string of RDN
    +2103      * @return {Array} array of AttrTypeAndValue parameters
    +2104      * @since jsrsasign 9.0.0 x509 2.0.0
    +2105      * @see {@link X509#getX500Name}
    +2106      * @see {@link X509#getRDN}
    +2107      * @see {@link X509#getAttrTypeAndValue}
    +2108      * @description
    +2109      * This method will get RelativeDistinguishedName parameters defined in
    +2110      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    +2111      * RFC 5280 4.1.2.4</a>.
    +2112      * <pre>
    +2113      * RelativeDistinguishedName ::=
    +2114      *   SET SIZE (1..MAX) OF AttributeTypeAndValue
    +2115      * </pre>
    +2116      * @example
    +2117      * x = new X509();
    +2118      * x.getRDN("31...") →
    +2119      * [{type:"C",value:"US",ds:"prn"}] or
    +2120      * [{type:"O",value:"Sample Corp.",ds:"prn"}] or
    +2121      * [{type:"CN",value:"john.smith@example.com",ds:"ia5"}]
    +2122      */
    +2123     this.getRDN = function(h) {
    +2124 	var result = [];
    +2125 	var a = _getChildIdx(h, 0);
    +2126 	for (var i = 0; i < a.length; i++) {
    +2127 	    result.push(this.getAttrTypeAndValue(_getTLV(h, a[i])));
    +2128 	}
    +2129 	return result;
    +2130     };
    +2131 
    +2132     /**
    +2133      * get AttributeTypeAndValue ASN.1 structure parameter as JSON object<br/>
    +2134      * @name getAttrTypeAndValue
    +2135      * @memberOf X509#
    +2136      * @function
    +2137      * @param {String} h hexadecimal string of AttributeTypeAndValue
    +2138      * @return {Object} JSON object of AttributeTypeAndValue parameters
    +2139      * @since jsrsasign 9.0.0 x509 2.0.0
    +2140      * @see {@link X509#getX500Name}
    +2141      * @see {@link X509#getRDN}
    +2142      * @description
    +2143      * This method will get AttributeTypeAndValue parameters defined in
    +2144      * <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.4">
    +2145      * RFC 5280 4.1.2.4</a>.
    +2146      * <pre>
    +2147      * AttributeTypeAndValue ::= SEQUENCE {
    +2148      *   type     AttributeType,
    +2149      *   value    AttributeValue }
    +2150      * AttributeType ::= OBJECT IDENTIFIER
    +2151      * AttributeValue ::= ANY -- DEFINED BY AttributeType
    +2152      * </pre>
    +2153      * <ul>
    +2154      * <li>{String}type - AttributeType name or OID(ex. C,O,CN)</li>
    +2155      * <li>{String}value - raw string of ASN.1 value of AttributeValue</li>
    +2156      * <li>{String}ds - DirectoryString type of AttributeValue</li>
    +2157      * </ul>
    +2158      * "ds" has one of following value:
    +2159      * <ul>
    +2160      * <li>utf8 - (0x0c) UTF8String</li>
    +2161      * <li>prn  - (0x13) PrintableString</li>
    +2162      * <li>ia5  - (0x16) IA5String</li>
    +2163      * <li>vis  - (0x1a) VisibleString</li>
    +2164      * <li>bmp  - (0x1e) BMPString</li>
    +2165      * </ul>
    +2166      * @example
    +2167      * x = new X509();
    +2168      * x.getAttrTypeAndValue("30...") →
    +2169      * {type:"CN",value:"john.smith@example.com",ds:"ia5"} or
    +2170      * {type:"O",value:"Sample Corp.",ds:"prn"}
    +2171      */
    +2172     // tel  - (0x14) TeletexString ... for future
    +2173     // num  - (0x12) NumericString ... for future
    +2174     // unv  - (0x1c??) UniversalString ... for future
    +2175     this.getAttrTypeAndValue = function(h) {
    +2176 	var result = {type: null, value: null, ds: null};
    +2177 	var a = _getChildIdx(h, 0);
    +2178 	var hOID = _getVbyList(h, a[0], [], "06");
    +2179 	var hValue = _getVbyList(h, a[1], []);
    +2180 	var oid = KJUR.asn1.ASN1Util.oidHexToInt(hOID);
    +2181 	result.type = KJUR.asn1.x509.OID.oid2atype(oid);
    +2182 	result.value = hextorstr(hValue);
    +2183 	result.ds = this.HEX2STAG[h.substr(a[1], 2)];
    +2184 	return result;
    +2185     };
    +2186 
    +2187     // ===== END X500Name related =====================================
    +2188 
    +2189     // ===== BEGIN read certificate =====================================
    +2190     /**
    +2191      * read PEM formatted X.509 certificate from string.<br/>
    +2192      * @name readCertPEM
    +2193      * @memberOf X509#
    +2194      * @function
    +2195      * @param {String} sCertPEM string for PEM formatted X.509 certificate
    +2196      * @example
    +2197      * x = new X509();
    +2198      * x.readCertPEM(sCertPEM); // read certificate
    +2199      */
    +2200     this.readCertPEM = function(sCertPEM) {
    +2201         this.readCertHex(_pemtohex(sCertPEM));
    +2202     };
    +2203 
    +2204     /**
    +2205      * read a hexadecimal string of X.509 certificate<br/>
    +2206      * @name readCertHex
    +2207      * @memberOf X509#
    +2208      * @function
    +2209      * @param {String} sCertHex hexadecimal string of X.509 certificate
    +2210      * @since jsrsasign 7.1.4 x509 1.1.13
    +2211      * @description
    +2212      * NOTE: {@link X509#parseExt} will called internally since jsrsasign 7.2.0.
    +2213      * @example
    +2214      * x = new X509();
    +2215      * x.readCertHex("3082..."); // read certificate
    +2216      */
    +2217     this.readCertHex = function(sCertHex) {
    +2218         this.hex = sCertHex;
    +2219 	this.getVersion(); // set version parameter
     2220 
    -2221     /** 
    -2222      * get array of certificate extension parameter JSON object<br/>
    -2223      * @name getExtParamArray
    -2224      * @memberOf X509#
    -2225      * @function
    -2226      * @param {String} hExtSeq hexadecimal string of SEQUENCE of Extension
    -2227      * @return {Array} array of certificate extension parameter JSON object
    -2228      * @since jsrsasign 9.0.0 x509 2.0.0
    -2229      * @see KJUR.asn1.x509.X509Util.newCertPEM
    -2230      * @see X509#getParam
    -2231      * @see X509#getExtParam
    -2232      * @see X509CRL#getParam
    -2233      * @see KJUR.asn1.csr.CSRUtil.getParam
    -2234      *
    -2235      * @description
    -2236      * This method returns an array of certificate extension
    -2237      * parameters. 
    -2238      * <br/>
    -2239      * NOTE: Argument "hExtSeq" have been supported since jsrsasign 9.1.1.
    -2240      *
    +2221 	try {
    +2222 	    _getIdxbyList(this.hex, 0, [0, 7], "a3"); // has [3] v3ext
    +2223 	    this.parseExt();
    +2224 	} catch(ex) {};
    +2225     };
    +2226 
    +2227     // ===== END read certificate =====================================
    +2228 
    +2229     /**
    +2230      * get JSON object of certificate parameters<br/>
    +2231      * @name getParam
    +2232      * @memberOf X509#
    +2233      * @function
    +2234      * @return {Array} JSON object of certificate parameters
    +2235      * @since jsrsasign 9.0.0 x509 2.0.0
    +2236      * @see KJUR.asn1.x509.X509Util.newCertPEM
    +2237      * @description
    +2238      * This method returns a JSON object of the certificate
    +2239      * parameters. Return value can be passed to
    +2240      * {@link KJUR.asn1.x509.X509Util.newCertPEM}.
     2241      * @example
     2242      * x = new X509();
     2243      * x.readCertPEM("-----BEGIN CERTIFICATE...");
    -2244      * x.getExtParamArray() →
    -2245      * [ {extname:"keyUsage",critical:true,names:["digitalSignature"]},
    -2246      *   {extname:"basicConstraints",critical:true},
    -2247      *   {extname:"subjectKeyIdentifier",kid:{hex:"f2eb..."}},
    -2248      *   {extname:"authorityKeyIdentifier",kid:{hex:"12ab..."}},
    -2249      *   {extname:"authorityInfoAccess",array:[{ocsp:"http://ocsp.example.com/"}]},
    -2250      *   {extname:"certificatePolicies",array:[{policyoid:"2.23.140.1.2.1"}]}]
    -2251      */
    -2252     this.getExtParamArray = function(hExtSeq) {
    -2253 	if (hExtSeq == undefined) {
    -2254 	    // for X.509v3 certificate
    -2255 	    var idx1 = _getIdxbyListEx(this.hex, 0, [0, "[3]"]);
    -2256 	    if (idx1 != -1) {
    -2257 		hExtSeq = _getTLVbyListEx(this.hex, 0, [0, "[3]", 0], "30");
    -2258 	    }
    -2259 	}
    -2260 	var result = [];
    -2261 	var aIdx = _getChildIdx(hExtSeq, 0);
    -2262 
    -2263 	for (var i = 0; i < aIdx.length; i++) {
    -2264 	    var hExt = _getTLV(hExtSeq, aIdx[i]);
    -2265 	    var extParam = this.getExtParam(hExt);
    -2266 	    if (extParam != null) result.push(extParam);
    -2267 	}
    -2268 
    -2269 	return result;
    -2270     };
    -2271 
    -2272     /** 
    -2273      * get a extension parameter JSON object<br/>
    -2274      * @name getExtParam
    -2275      * @memberOf X509#
    -2276      * @function
    -2277      * @param {String} hExt hexadecimal string of Extension
    -2278      * @return {Array} Extension parameter JSON object
    -2279      * @since jsrsasign 9.1.1 x509 2.0.1
    -2280      * @see KJUR.asn1.x509.X509Util.newCertPEM
    -2281      * @see X509#getParam
    -2282      * @see X509#getExtParamArray
    -2283      * @see X509CRL#getParam
    -2284      * @see KJUR.asn1.csr.CSRUtil.getParam
    -2285      *
    -2286      * @description
    -2287      * This method returns a extension parameters as JSON object. 
    -2288      *
    -2289      * @example
    -2290      * x = new X509();
    -2291      * ...
    -2292      * x.getExtParam("30...") →
    -2293      * {extname:"keyUsage",critical:true,names:["digitalSignature"]}
    -2294      */
    -2295     this.getExtParam = function(hExt) {
    -2296 	var result = {};
    -2297 	var aIdx = _getChildIdx(hExt, 0);
    -2298 	var aIdxLen = aIdx.length;
    -2299 	if (aIdxLen != 2 && aIdxLen != 3)
    -2300 	    throw new Error("wrong number elements in Extension: " + 
    -2301 			    aIdxLen + " " + hExt);
    -2302 
    -2303 	var oid = _hextooidstr(_getVbyList(hExt, 0, [0], "06"));
    -2304 
    -2305 	var critical = false;
    -2306 	if (aIdxLen == 3 && _getTLVbyList(hExt, 0, [1]) == "0101ff")
    -2307 	    critical = true;
    -2308 
    -2309 	var hExtV = _getTLVbyList(hExt, 0, [aIdxLen - 1, 0]);
    -2310 
    -2311 	var extParam = undefined;
    -2312 	if (oid == "2.5.29.14") {
    -2313 	    extParam = this.getExtSubjectKeyIdentifier(hExtV, critical);
    -2314 	} else if (oid == "2.5.29.15") {
    -2315 	    extParam = this.getExtKeyUsage(hExtV, critical);
    -2316 	} else if (oid == "2.5.29.17") {
    -2317 	    extParam = this.getExtSubjectAltName(hExtV, critical);
    -2318 	} else if (oid == "2.5.29.18") {
    -2319 	    extParam = this.getExtIssuerAltName(hExtV, critical);
    -2320 	} else if (oid == "2.5.29.19") {
    -2321 	    extParam = this.getExtBasicConstraints(hExtV, critical);
    -2322 	} else if (oid == "2.5.29.31") {
    -2323 	    extParam = this.getExtCRLDistributionPoints(hExtV, critical);
    -2324 	} else if (oid == "2.5.29.32") {
    -2325 	    extParam = this.getExtCertificatePolicies(hExtV, critical);
    -2326 	} else if (oid == "2.5.29.35") {
    -2327 	    extParam = this.getExtAuthorityKeyIdentifier(hExtV, critical);
    -2328 	} else if (oid == "2.5.29.37") {
    -2329 	    extParam = this.getExtExtKeyUsage(hExtV, critical);
    -2330 	} else if (oid == "1.3.6.1.5.5.7.1.1") {
    -2331 	    extParam = this.getExtAuthorityInfoAccess(hExtV, critical);
    -2332 	} else if (oid == "2.5.29.20") {
    -2333 	    extParam = this.getExtCRLNumber(hExtV, critical);
    -2334 	} else if (oid == "2.5.29.21") {
    -2335 	    extParam = this.getExtCRLReason(hExtV, critical);
    -2336 	} else if (oid == "1.3.6.1.5.5.7.48.1.2") {
    -2337 	    extParam = this.getExtOcspNonce(hExtV, critical);
    -2338 	} else if (oid == "1.3.6.1.5.5.7.48.1.5") {
    -2339 	    extParam = this.getExtOcspNoCheck(hExtV, critical);
    -2340 	}
    -2341 	if (extParam != undefined) return extParam;
    -2342 
    -2343 	var privateParam = { extname: oid, extn: hExtV };
    -2344 	if (critical) privateParam.critical = true;
    -2345 	return privateParam;
    -2346     };
    -2347 
    -2348     /**
    -2349      * get certificate information as string.<br/>
    -2350      * @name getInfo
    -2351      * @memberOf X509#
    -2352      * @function
    -2353      * @return {String} certificate information string
    -2354      * @since jsrsasign 5.0.10 x509 1.1.8
    -2355      * @example
    -2356      * x = new X509();
    -2357      * x.readCertPEM(certPEM);
    -2358      * console.log(x.getInfo());
    -2359      * // this shows as following
    -2360      * Basic Fields
    -2361      *   serial number: 02ac5c266a0b409b8f0b79f2ae462577
    -2362      *   signature algorithm: SHA1withRSA
    -2363      *   issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
    -2364      *   notBefore: 061110000000Z
    -2365      *   notAfter: 311110000000Z
    -2366      *   subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
    -2367      *   subject public key info:
    -2368      *     key algorithm: RSA
    -2369      *     n=c6cce573e6fbd4bb...
    -2370      *     e=10001
    -2371      * X509v3 Extensions:
    -2372      *   keyUsage CRITICAL:
    -2373      *     digitalSignature,keyCertSign,cRLSign
    -2374      *   basicConstraints CRITICAL:
    -2375      *     cA=true
    -2376      *   subjectKeyIdentifier :
    -2377      *     b13ec36903f8bf4701d498261a0802ef63642bc3
    -2378      *   authorityKeyIdentifier :
    -2379      *     kid=b13ec36903f8bf4701d498261a0802ef63642bc3
    -2380      * signature algorithm: SHA1withRSA
    -2381      * signature: 1c1a0697dcd79c9f...
    -2382      */
    -2383     this.getInfo = function() {
    -2384 	var _getSubjectAltNameStr = function(params) {
    -2385 	    var s = JSON.stringify(params.array).replace(/[\[\]\{\}\"]/g, '');
    -2386 	    return s;
    -2387 	};
    -2388 	var _getCertificatePoliciesStr = function(params) {
    -2389 	    var s = "";
    -2390 	    var a = params.array;
    -2391 	    for (var i = 0; i < a.length; i++) {
    -2392 		var pi = a[i];
    -2393 		s += "    policy oid: " + pi.policyoid + "\n";
    -2394 		if (pi.array === undefined) continue;
    -2395 		for (var j = 0; j < pi.array.length; j++) {
    -2396 		    var pqi = pi.array[j];
    -2397 		    if (pqi.cps !== undefined) {
    -2398 			s += "    cps: " + pqi.cps + "\n";
    -2399 		    }
    -2400 		}
    -2401 	    }
    -2402 	    return s;
    -2403 	};
    -2404 	var _getCRLDistributionPointsStr = function(params) {
    -2405 	    var s = "";
    -2406 	    var a = params.array;
    -2407 	    for (var i = 0; i < a.length; i++) {
    -2408 		var dp = a[i];
    -2409 		try {
    -2410 		    if (dp.dpname.full[0].uri !== undefined)
    -2411 			s += "    " + dp.dpname.full[0].uri + "\n";
    -2412 		} catch(ex) {};
    -2413 		try {
    -2414 		    if (dp.dname.full[0].dn.hex !== undefined)
    -2415 			s += "    " + X509.hex2dn(dp.dpname.full[0].dn.hex) + "\n";
    -2416 		} catch(ex) {};
    -2417 	    }
    -2418 	    return s;
    -2419 	}
    -2420 	var _getAuthorityInfoAccessStr = function(params) {
    -2421 	    var s = "";
    -2422 	    var a = params.array;
    -2423 	    for (var i = 0; i < a.length; i++) {
    -2424 		var ad = a[i];
    -2425 
    -2426 		if (ad.caissuer !== undefined)
    -2427 		    s += "    caissuer: " + ad.caissuer + "\n";
    -2428 		if (ad.ocsp !== undefined)
    -2429 		    s += "    ocsp: " + ad.ocsp + "\n";
    -2430 	    }
    -2431 	    return s;
    -2432 	};
    -2433 	var _X509 = X509;
    -2434 	var s, pubkey, aExt;
    -2435 	s  = "Basic Fields\n";
    -2436         s += "  serial number: " + this.getSerialNumberHex() + "\n";
    -2437 	s += "  signature algorithm: " + this.getSignatureAlgorithmField() + "\n";
    -2438 	s += "  issuer: " + this.getIssuerString() + "\n";
    -2439 	s += "  notBefore: " + this.getNotBefore() + "\n";
    -2440 	s += "  notAfter: " + this.getNotAfter() + "\n";
    -2441 	s += "  subject: " + this.getSubjectString() + "\n";
    -2442 	s += "  subject public key info: " + "\n";
    -2443 
    -2444 	// subject public key info
    -2445 	pubkey = this.getPublicKey();
    -2446 	s += "    key algorithm: " + pubkey.type + "\n";
    -2447 
    -2448 	if (pubkey.type === "RSA") {
    -2449 	    s += "    n=" + hextoposhex(pubkey.n.toString(16)).substr(0, 16) + "...\n";
    -2450 	    s += "    e=" + hextoposhex(pubkey.e.toString(16)) + "\n";
    -2451 	}
    -2452 
    -2453 	// X.509v3 Extensions
    -2454         aExt = this.aExtInfo;
    -2455 
    -2456 	if (aExt !== undefined && aExt !== null) {
    -2457             s += "X509v3 Extensions:\n";
    -2458 	    
    -2459             for (var i = 0; i < aExt.length; i++) {
    -2460 		var info = aExt[i];
    -2461 
    -2462 		// show extension name and critical flag
    -2463 		var extName = KJUR.asn1.x509.OID.oid2name(info["oid"]);
    -2464 		if (extName === '') extName = info["oid"];
    -2465 
    -2466 		var critical = '';
    -2467 		if (info["critical"] === true) critical = "CRITICAL";
    -2468 
    -2469 		s += "  " + extName + " " + critical + ":\n";
    -2470 
    -2471 		// show extension value if supported
    -2472 		if (extName === "basicConstraints") {
    -2473 		    var bc = this.getExtBasicConstraints();
    -2474 		    if (bc.cA === undefined) {
    -2475 			s += "    {}\n";
    -2476 		    } else {
    -2477 			s += "    cA=true";
    -2478 			if (bc.pathLen !== undefined)
    -2479 			    s += ", pathLen=" + bc.pathLen;
    -2480 			s += "\n";
    -2481 		    }
    -2482 		} else if (extName === "keyUsage") {
    -2483 		    s += "    " + this.getExtKeyUsageString() + "\n";
    -2484 		} else if (extName === "subjectKeyIdentifier") {
    -2485 		    s += "    " + this.getExtSubjectKeyIdentifier().kid.hex + "\n";
    -2486 		} else if (extName === "authorityKeyIdentifier") {
    -2487 		    var akid = this.getExtAuthorityKeyIdentifier();
    -2488 		    if (akid.kid !== undefined)
    -2489 			s += "    kid=" + akid.kid.hex + "\n";
    -2490 		} else if (extName === "extKeyUsage") {
    -2491 		    var eku = this.getExtExtKeyUsage().array;
    -2492 		    s += "    " + eku.join(", ") + "\n";
    -2493 		} else if (extName === "subjectAltName") {
    -2494 		    var san = _getSubjectAltNameStr(this.getExtSubjectAltName());
    -2495 		    s += "    " + san + "\n";
    -2496 		} else if (extName === "cRLDistributionPoints") {
    -2497 		    var cdp = this.getExtCRLDistributionPoints();
    -2498 		    s += _getCRLDistributionPointsStr(cdp);
    -2499 		} else if (extName === "authorityInfoAccess") {
    -2500 		    var aia = this.getExtAuthorityInfoAccess();
    -2501 		    s += _getAuthorityInfoAccessStr(aia);
    -2502 		} else if (extName === "certificatePolicies") {
    -2503 		    s += _getCertificatePoliciesStr(this.getExtCertificatePolicies());
    -2504 		}
    -2505 	    }
    -2506         }
    -2507 
    -2508 	s += "signature algorithm: " + this.getSignatureAlgorithmName() + "\n";
    -2509 	s += "signature: " + this.getSignatureValueHex().substr(0, 16) + "...\n";
    -2510 	return s;
    -2511     };
    -2512 
    -2513     if (typeof params == "string") {
    -2514 	if (params.indexOf("-----BEGIN") != -1) {
    -2515 	    this.readCertPEM(params);
    -2516 	} else if (KJUR.lang.String.isHex(params)) {
    -2517 	    this.readCertHex(params);
    -2518 	}
    -2519     }
    -2520 };
    -2521 // ----- END of X509 class -----
    -2522 
    -2523 /**
    -2524  * get distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER X.500 name<br/>
    -2525  * @name hex2dn
    -2526  * @memberOf X509
    -2527  * @function
    -2528  * @param {String} hex hexadecimal string of ASN.1 DER distinguished name
    -2529  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
    -2530  * @return {String} OpenSSL online format distinguished name
    -2531  * @description
    -2532  * This static method converts from a hexadecimal string of 
    -2533  * distinguished name (DN)
    -2534  * specified by 'hex' and 'idx' to OpenSSL oneline string representation (ex. /C=US/O=a).
    -2535  * @example
    -2536  * X509.hex2dn("3031310b3...") → /C=US/O=a/CN=b2+OU=b1
    -2537  */
    -2538 X509.hex2dn = function(hex, idx) {
    -2539     if (idx === undefined) idx = 0;
    -2540     if (hex.substr(idx, 2) !== "30") throw new Error("malformed DN");
    -2541 
    -2542     var a = new Array();
    -2543 
    -2544     var aIdx = ASN1HEX.getChildIdx(hex, idx);
    -2545     for (var i = 0; i < aIdx.length; i++) {
    -2546 	a.push(X509.hex2rdn(hex, aIdx[i]));
    -2547     }
    -2548 
    -2549     a = a.map(function(s) { return s.replace("/", "\\/"); });
    -2550     return "/" + a.join("/");
    -2551 };
    -2552 
    -2553 /**
    -2554  * get relative distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER RDN<br/>
    -2555  * @name hex2rdn
    -2556  * @memberOf X509
    -2557  * @function
    -2558  * @param {String} hex hexadecimal string of ASN.1 DER concludes relative distinguished name
    -2559  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
    -2560  * @return {String} OpenSSL online format relative distinguished name
    -2561  * @description
    -2562  * This static method converts from a hexadecimal string of 
    -2563  * relative distinguished name (RDN)
    -2564  * specified by 'hex' and 'idx' to LDAP string representation (ex. O=test+CN=test).<br/>
    -2565  * NOTE: Multi-valued RDN is supported since jsnrsasign 6.2.2 x509 1.1.10.
    -2566  * @example
    -2567  * X509.hex2rdn("310a3008060355040a0c0161") → O=a
    -2568  * X509.hex2rdn("31143008060355040a0c01613008060355040a0c0162") → O=a+O=b
    -2569  */
    -2570 X509.hex2rdn = function(hex, idx) {
    -2571     if (idx === undefined) idx = 0;
    -2572     if (hex.substr(idx, 2) !== "31") throw new Error("malformed RDN");
    -2573 
    -2574     var a = new Array();
    -2575 
    -2576     var aIdx = ASN1HEX.getChildIdx(hex, idx);
    -2577     for (var i = 0; i < aIdx.length; i++) {
    -2578 	a.push(X509.hex2attrTypeValue(hex, aIdx[i]));
    -2579     }
    -2580 
    -2581     a = a.map(function(s) { return s.replace("+", "\\+"); });
    -2582     return a.join("+");
    -2583 };
    +2244      * x.getParam() →
    +2245      * {version:3,
    +2246      *  serial:{hex:"12ab"},
    +2247      *  sigalg:"SHA256withRSA",
    +2248      *  issuer: {array:[[{type:'CN',value:'CA1',ds:'prn'}]],str:"/O=CA1"},
    +2249      *  notbefore:"160403023700Z",
    +2250      *  notafter:"160702023700Z",
    +2251      *  subject: {array:[[{type:'CN',value:'Test1',ds:'prn'}]],str:"/CN=Test1"},
    +2252      *  sbjpubkey:"-----BEGIN PUBLIC KEY...",
    +2253      *  ext:[
    +2254      *   {extname:"keyUsage",critical:true,names:["digitalSignature"]},
    +2255      *   {extname:"basicConstraints",critical:true},
    +2256      *   {extname:"subjectKeyIdentifier",kid:{hex:"f2eb..."}},
    +2257      *   {extname:"authorityKeyIdentifier",kid:{hex:"12ab..."}},
    +2258      *   {extname:"authorityInfoAccess",array:[{ocsp:"http://ocsp.example.com/"}]},
    +2259      *   {extname:"certificatePolicies",array:[{policyoid:"2.23.140.1.2.1"}]}
    +2260      *  }],
    +2261      *  sighex:"0b76...8"
    +2262      * };
    +2263      */
    +2264     this.getParam = function() {
    +2265 	var result = {};
    +2266 	result.version = this.getVersion();
    +2267 	result.serial = {hex: this.getSerialNumberHex()};
    +2268 	result.sigalg = this.getSignatureAlgorithmField();
    +2269 	result.issuer = this.getIssuer();
    +2270 	result.notbefore = this.getNotBefore();
    +2271 	result.notafter = this.getNotAfter();
    +2272 	result.subject = this.getSubject();
    +2273 	result.sbjpubkey = hextopem(this.getPublicKeyHex(), "PUBLIC KEY");
    +2274 	if (this.aExtInfo.length > 0) {
    +2275 	    result.ext = this.getExtParamArray();
    +2276 	}
    +2277 	result.sighex = this.getSignatureValueHex();
    +2278 	return result;
    +2279     };
    +2280 
    +2281     /** 
    +2282      * get array of certificate extension parameter JSON object<br/>
    +2283      * @name getExtParamArray
    +2284      * @memberOf X509#
    +2285      * @function
    +2286      * @param {String} hExtSeq hexadecimal string of SEQUENCE of Extension
    +2287      * @return {Array} array of certificate extension parameter JSON object
    +2288      * @since jsrsasign 9.0.0 x509 2.0.0
    +2289      * @see KJUR.asn1.x509.X509Util.newCertPEM
    +2290      * @see X509#getParam
    +2291      * @see X509#getExtParam
    +2292      * @see X509CRL#getParam
    +2293      * @see KJUR.asn1.csr.CSRUtil.getParam
    +2294      *
    +2295      * @description
    +2296      * This method returns an array of certificate extension
    +2297      * parameters. 
    +2298      * <br/>
    +2299      * NOTE: Argument "hExtSeq" have been supported since jsrsasign 9.1.1.
    +2300      *
    +2301      * @example
    +2302      * x = new X509();
    +2303      * x.readCertPEM("-----BEGIN CERTIFICATE...");
    +2304      * x.getExtParamArray() →
    +2305      * [ {extname:"keyUsage",critical:true,names:["digitalSignature"]},
    +2306      *   {extname:"basicConstraints",critical:true},
    +2307      *   {extname:"subjectKeyIdentifier",kid:{hex:"f2eb..."}},
    +2308      *   {extname:"authorityKeyIdentifier",kid:{hex:"12ab..."}},
    +2309      *   {extname:"authorityInfoAccess",array:[{ocsp:"http://ocsp.example.com/"}]},
    +2310      *   {extname:"certificatePolicies",array:[{policyoid:"2.23.140.1.2.1"}]}]
    +2311      */
    +2312     this.getExtParamArray = function(hExtSeq) {
    +2313 	if (hExtSeq == undefined) {
    +2314 	    // for X.509v3 certificate
    +2315 	    var idx1 = _getIdxbyListEx(this.hex, 0, [0, "[3]"]);
    +2316 	    if (idx1 != -1) {
    +2317 		hExtSeq = _getTLVbyListEx(this.hex, 0, [0, "[3]", 0], "30");
    +2318 	    }
    +2319 	}
    +2320 	var result = [];
    +2321 	var aIdx = _getChildIdx(hExtSeq, 0);
    +2322 
    +2323 	for (var i = 0; i < aIdx.length; i++) {
    +2324 	    var hExt = _getTLV(hExtSeq, aIdx[i]);
    +2325 	    var extParam = this.getExtParam(hExt);
    +2326 	    if (extParam != null) result.push(extParam);
    +2327 	}
    +2328 
    +2329 	return result;
    +2330     };
    +2331 
    +2332     /** 
    +2333      * get a extension parameter JSON object<br/>
    +2334      * @name getExtParam
    +2335      * @memberOf X509#
    +2336      * @function
    +2337      * @param {String} hExt hexadecimal string of Extension
    +2338      * @return {Array} Extension parameter JSON object
    +2339      * @since jsrsasign 9.1.1 x509 2.0.1
    +2340      * @see KJUR.asn1.x509.X509Util.newCertPEM
    +2341      * @see X509#getParam
    +2342      * @see X509#getExtParamArray
    +2343      * @see X509CRL#getParam
    +2344      * @see KJUR.asn1.csr.CSRUtil.getParam
    +2345      *
    +2346      * @description
    +2347      * This method returns a extension parameters as JSON object. 
    +2348      *
    +2349      * @example
    +2350      * x = new X509();
    +2351      * ...
    +2352      * x.getExtParam("30...") →
    +2353      * {extname:"keyUsage",critical:true,names:["digitalSignature"]}
    +2354      */
    +2355     this.getExtParam = function(hExt) {
    +2356 	var result = {};
    +2357 	var aIdx = _getChildIdx(hExt, 0);
    +2358 	var aIdxLen = aIdx.length;
    +2359 	if (aIdxLen != 2 && aIdxLen != 3)
    +2360 	    throw new Error("wrong number elements in Extension: " + 
    +2361 			    aIdxLen + " " + hExt);
    +2362 
    +2363 	var oid = _hextooidstr(_getVbyList(hExt, 0, [0], "06"));
    +2364 
    +2365 	var critical = false;
    +2366 	if (aIdxLen == 3 && _getTLVbyList(hExt, 0, [1]) == "0101ff")
    +2367 	    critical = true;
    +2368 
    +2369 	var hExtV = _getTLVbyList(hExt, 0, [aIdxLen - 1, 0]);
    +2370 
    +2371 	var extParam = undefined;
    +2372 	if (oid == "2.5.29.14") {
    +2373 	    extParam = this.getExtSubjectKeyIdentifier(hExtV, critical);
    +2374 	} else if (oid == "2.5.29.15") {
    +2375 	    extParam = this.getExtKeyUsage(hExtV, critical);
    +2376 	} else if (oid == "2.5.29.17") {
    +2377 	    extParam = this.getExtSubjectAltName(hExtV, critical);
    +2378 	} else if (oid == "2.5.29.18") {
    +2379 	    extParam = this.getExtIssuerAltName(hExtV, critical);
    +2380 	} else if (oid == "2.5.29.19") {
    +2381 	    extParam = this.getExtBasicConstraints(hExtV, critical);
    +2382 	} else if (oid == "2.5.29.31") {
    +2383 	    extParam = this.getExtCRLDistributionPoints(hExtV, critical);
    +2384 	} else if (oid == "2.5.29.32") {
    +2385 	    extParam = this.getExtCertificatePolicies(hExtV, critical);
    +2386 	} else if (oid == "2.5.29.35") {
    +2387 	    extParam = this.getExtAuthorityKeyIdentifier(hExtV, critical);
    +2388 	} else if (oid == "2.5.29.37") {
    +2389 	    extParam = this.getExtExtKeyUsage(hExtV, critical);
    +2390 	} else if (oid == "1.3.6.1.5.5.7.1.1") {
    +2391 	    extParam = this.getExtAuthorityInfoAccess(hExtV, critical);
    +2392 	} else if (oid == "2.5.29.20") {
    +2393 	    extParam = this.getExtCRLNumber(hExtV, critical);
    +2394 	} else if (oid == "2.5.29.21") {
    +2395 	    extParam = this.getExtCRLReason(hExtV, critical);
    +2396 	} else if (oid == "1.3.6.1.5.5.7.48.1.2") {
    +2397 	    extParam = this.getExtOcspNonce(hExtV, critical);
    +2398 	} else if (oid == "1.3.6.1.5.5.7.48.1.5") {
    +2399 	    extParam = this.getExtOcspNoCheck(hExtV, critical);
    +2400 	} else if (oid == "1.2.840.113583.1.1.9.1") {
    +2401 	    extParam = this.getExtAdobeTimeStamp(hExtV, critical);
    +2402 	}
    +2403 	if (extParam != undefined) return extParam;
    +2404 
    +2405 	var privateParam = { extname: oid, extn: hExtV };
    +2406 	if (critical) privateParam.critical = true;
    +2407 	return privateParam;
    +2408     };
    +2409 
    +2410     /**
    +2411      * get certificate information as string.<br/>
    +2412      * @name getInfo
    +2413      * @memberOf X509#
    +2414      * @function
    +2415      * @return {String} certificate information string
    +2416      * @since jsrsasign 5.0.10 x509 1.1.8
    +2417      * @example
    +2418      * x = new X509();
    +2419      * x.readCertPEM(certPEM);
    +2420      * console.log(x.getInfo());
    +2421      * // this shows as following
    +2422      * Basic Fields
    +2423      *   serial number: 02ac5c266a0b409b8f0b79f2ae462577
    +2424      *   signature algorithm: SHA1withRSA
    +2425      *   issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
    +2426      *   notBefore: 061110000000Z
    +2427      *   notAfter: 311110000000Z
    +2428      *   subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
    +2429      *   subject public key info:
    +2430      *     key algorithm: RSA
    +2431      *     n=c6cce573e6fbd4bb...
    +2432      *     e=10001
    +2433      * X509v3 Extensions:
    +2434      *   keyUsage CRITICAL:
    +2435      *     digitalSignature,keyCertSign,cRLSign
    +2436      *   basicConstraints CRITICAL:
    +2437      *     cA=true
    +2438      *   subjectKeyIdentifier :
    +2439      *     b13ec36903f8bf4701d498261a0802ef63642bc3
    +2440      *   authorityKeyIdentifier :
    +2441      *     kid=b13ec36903f8bf4701d498261a0802ef63642bc3
    +2442      * signature algorithm: SHA1withRSA
    +2443      * signature: 1c1a0697dcd79c9f...
    +2444      */
    +2445     this.getInfo = function() {
    +2446 	var _getSubjectAltNameStr = function(params) {
    +2447 	    var s = JSON.stringify(params.array).replace(/[\[\]\{\}\"]/g, '');
    +2448 	    return s;
    +2449 	};
    +2450 	var _getCertificatePoliciesStr = function(params) {
    +2451 	    var s = "";
    +2452 	    var a = params.array;
    +2453 	    for (var i = 0; i < a.length; i++) {
    +2454 		var pi = a[i];
    +2455 		s += "    policy oid: " + pi.policyoid + "\n";
    +2456 		if (pi.array === undefined) continue;
    +2457 		for (var j = 0; j < pi.array.length; j++) {
    +2458 		    var pqi = pi.array[j];
    +2459 		    if (pqi.cps !== undefined) {
    +2460 			s += "    cps: " + pqi.cps + "\n";
    +2461 		    }
    +2462 		}
    +2463 	    }
    +2464 	    return s;
    +2465 	};
    +2466 	var _getCRLDistributionPointsStr = function(params) {
    +2467 	    var s = "";
    +2468 	    var a = params.array;
    +2469 	    for (var i = 0; i < a.length; i++) {
    +2470 		var dp = a[i];
    +2471 		try {
    +2472 		    if (dp.dpname.full[0].uri !== undefined)
    +2473 			s += "    " + dp.dpname.full[0].uri + "\n";
    +2474 		} catch(ex) {};
    +2475 		try {
    +2476 		    if (dp.dname.full[0].dn.hex !== undefined)
    +2477 			s += "    " + X509.hex2dn(dp.dpname.full[0].dn.hex) + "\n";
    +2478 		} catch(ex) {};
    +2479 	    }
    +2480 	    return s;
    +2481 	}
    +2482 	var _getAuthorityInfoAccessStr = function(params) {
    +2483 	    var s = "";
    +2484 	    var a = params.array;
    +2485 	    for (var i = 0; i < a.length; i++) {
    +2486 		var ad = a[i];
    +2487 
    +2488 		if (ad.caissuer !== undefined)
    +2489 		    s += "    caissuer: " + ad.caissuer + "\n";
    +2490 		if (ad.ocsp !== undefined)
    +2491 		    s += "    ocsp: " + ad.ocsp + "\n";
    +2492 	    }
    +2493 	    return s;
    +2494 	};
    +2495 	var _X509 = X509;
    +2496 	var s, pubkey, aExt;
    +2497 	s  = "Basic Fields\n";
    +2498         s += "  serial number: " + this.getSerialNumberHex() + "\n";
    +2499 	s += "  signature algorithm: " + this.getSignatureAlgorithmField() + "\n";
    +2500 	s += "  issuer: " + this.getIssuerString() + "\n";
    +2501 	s += "  notBefore: " + this.getNotBefore() + "\n";
    +2502 	s += "  notAfter: " + this.getNotAfter() + "\n";
    +2503 	s += "  subject: " + this.getSubjectString() + "\n";
    +2504 	s += "  subject public key info: " + "\n";
    +2505 
    +2506 	// subject public key info
    +2507 	pubkey = this.getPublicKey();
    +2508 	s += "    key algorithm: " + pubkey.type + "\n";
    +2509 
    +2510 	if (pubkey.type === "RSA") {
    +2511 	    s += "    n=" + hextoposhex(pubkey.n.toString(16)).substr(0, 16) + "...\n";
    +2512 	    s += "    e=" + hextoposhex(pubkey.e.toString(16)) + "\n";
    +2513 	}
    +2514 
    +2515 	// X.509v3 Extensions
    +2516         aExt = this.aExtInfo;
    +2517 
    +2518 	if (aExt !== undefined && aExt !== null) {
    +2519             s += "X509v3 Extensions:\n";
    +2520 	    
    +2521             for (var i = 0; i < aExt.length; i++) {
    +2522 		var info = aExt[i];
    +2523 
    +2524 		// show extension name and critical flag
    +2525 		var extName = KJUR.asn1.x509.OID.oid2name(info["oid"]);
    +2526 		if (extName === '') extName = info["oid"];
    +2527 
    +2528 		var critical = '';
    +2529 		if (info["critical"] === true) critical = "CRITICAL";
    +2530 
    +2531 		s += "  " + extName + " " + critical + ":\n";
    +2532 
    +2533 		// show extension value if supported
    +2534 		if (extName === "basicConstraints") {
    +2535 		    var bc = this.getExtBasicConstraints();
    +2536 		    if (bc.cA === undefined) {
    +2537 			s += "    {}\n";
    +2538 		    } else {
    +2539 			s += "    cA=true";
    +2540 			if (bc.pathLen !== undefined)
    +2541 			    s += ", pathLen=" + bc.pathLen;
    +2542 			s += "\n";
    +2543 		    }
    +2544 		} else if (extName === "keyUsage") {
    +2545 		    s += "    " + this.getExtKeyUsageString() + "\n";
    +2546 		} else if (extName === "subjectKeyIdentifier") {
    +2547 		    s += "    " + this.getExtSubjectKeyIdentifier().kid.hex + "\n";
    +2548 		} else if (extName === "authorityKeyIdentifier") {
    +2549 		    var akid = this.getExtAuthorityKeyIdentifier();
    +2550 		    if (akid.kid !== undefined)
    +2551 			s += "    kid=" + akid.kid.hex + "\n";
    +2552 		} else if (extName === "extKeyUsage") {
    +2553 		    var eku = this.getExtExtKeyUsage().array;
    +2554 		    s += "    " + eku.join(", ") + "\n";
    +2555 		} else if (extName === "subjectAltName") {
    +2556 		    var san = _getSubjectAltNameStr(this.getExtSubjectAltName());
    +2557 		    s += "    " + san + "\n";
    +2558 		} else if (extName === "cRLDistributionPoints") {
    +2559 		    var cdp = this.getExtCRLDistributionPoints();
    +2560 		    s += _getCRLDistributionPointsStr(cdp);
    +2561 		} else if (extName === "authorityInfoAccess") {
    +2562 		    var aia = this.getExtAuthorityInfoAccess();
    +2563 		    s += _getAuthorityInfoAccessStr(aia);
    +2564 		} else if (extName === "certificatePolicies") {
    +2565 		    s += _getCertificatePoliciesStr(this.getExtCertificatePolicies());
    +2566 		}
    +2567 	    }
    +2568         }
    +2569 
    +2570 	s += "signature algorithm: " + this.getSignatureAlgorithmName() + "\n";
    +2571 	s += "signature: " + this.getSignatureValueHex().substr(0, 16) + "...\n";
    +2572 	return s;
    +2573     };
    +2574 
    +2575     if (typeof params == "string") {
    +2576 	if (params.indexOf("-----BEGIN") != -1) {
    +2577 	    this.readCertPEM(params);
    +2578 	} else if (KJUR.lang.String.isHex(params)) {
    +2579 	    this.readCertHex(params);
    +2580 	}
    +2581     }
    +2582 };
    +2583 // ----- END of X509 class -----
     2584 
     2585 /**
    -2586  * get string from hexadecimal string of ASN.1 DER AttributeTypeAndValue<br/>
    -2587  * @name hex2attrTypeValue
    +2586  * get distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER X.500 name<br/>
    +2587  * @name hex2dn
     2588  * @memberOf X509
     2589  * @function
    -2590  * @param {String} hex hexadecimal string of ASN.1 DER concludes AttributeTypeAndValue
    +2590  * @param {String} hex hexadecimal string of ASN.1 DER distinguished name
     2591  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
    -2592  * @return {String} string representation of AttributeTypeAndValue (ex. C=US)
    +2592  * @return {String} OpenSSL online format distinguished name
     2593  * @description
    -2594  * This static method converts from a hexadecimal string of AttributeTypeAndValue
    -2595  * specified by 'hex' and 'idx' to LDAP string representation (ex. C=US).
    -2596  * @example
    -2597  * X509.hex2attrTypeValue("3008060355040a0c0161") → O=a
    -2598  * X509.hex2attrTypeValue("300806035504060c0161") → C=a
    -2599  * X509.hex2attrTypeValue("...3008060355040a0c0161...", 128) → O=a
    -2600  */
    -2601 X509.hex2attrTypeValue = function(hex, idx) {
    -2602     var _ASN1HEX = ASN1HEX;
    -2603     var _getV = _ASN1HEX.getV;
    -2604 
    -2605     if (idx === undefined) idx = 0;
    -2606     if (hex.substr(idx, 2) !== "30") 
    -2607 	throw new Error("malformed attribute type and value");
    -2608 
    -2609     var aIdx = _ASN1HEX.getChildIdx(hex, idx);
    -2610     if (aIdx.length !== 2 || hex.substr(aIdx[0], 2) !== "06")
    -2611 	"malformed attribute type and value";
    -2612 
    -2613     var oidHex = _getV(hex, aIdx[0]);
    -2614     var oidInt = KJUR.asn1.ASN1Util.oidHexToInt(oidHex);
    -2615     var atype = KJUR.asn1.x509.OID.oid2atype(oidInt);
    -2616 
    -2617     var hV = _getV(hex, aIdx[1]);
    -2618     var rawV = hextorstr(hV);
    -2619 
    -2620     return atype + "=" + rawV;
    -2621 };
    -2622 
    -2623 /**
    -2624  * get RSA/DSA/ECDSA public key object from X.509 certificate hexadecimal string<br/>
    -2625  * @name getPublicKeyFromCertHex
    -2626  * @memberOf X509
    -2627  * @function
    -2628  * @param {String} h hexadecimal string of X.509 certificate for RSA/ECDSA/DSA public key
    -2629  * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
    -2630  * @since jsrasign 7.1.0 x509 1.1.11
    +2594  * This static method converts from a hexadecimal string of 
    +2595  * distinguished name (DN)
    +2596  * specified by 'hex' and 'idx' to OpenSSL oneline string representation (ex. /C=US/O=a).
    +2597  * @example
    +2598  * X509.hex2dn("3031310b3...") → /C=US/O=a/CN=b2+OU=b1
    +2599  */
    +2600 X509.hex2dn = function(hex, idx) {
    +2601     if (idx === undefined) idx = 0;
    +2602     if (hex.substr(idx, 2) !== "30") throw new Error("malformed DN");
    +2603 
    +2604     var a = new Array();
    +2605 
    +2606     var aIdx = ASN1HEX.getChildIdx(hex, idx);
    +2607     for (var i = 0; i < aIdx.length; i++) {
    +2608 	a.push(X509.hex2rdn(hex, aIdx[i]));
    +2609     }
    +2610 
    +2611     a = a.map(function(s) { return s.replace("/", "\\/"); });
    +2612     return "/" + a.join("/");
    +2613 };
    +2614 
    +2615 /**
    +2616  * get relative distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER RDN<br/>
    +2617  * @name hex2rdn
    +2618  * @memberOf X509
    +2619  * @function
    +2620  * @param {String} hex hexadecimal string of ASN.1 DER concludes relative distinguished name
    +2621  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
    +2622  * @return {String} OpenSSL online format relative distinguished name
    +2623  * @description
    +2624  * This static method converts from a hexadecimal string of 
    +2625  * relative distinguished name (RDN)
    +2626  * specified by 'hex' and 'idx' to LDAP string representation (ex. O=test+CN=test).<br/>
    +2627  * NOTE: Multi-valued RDN is supported since jsnrsasign 6.2.2 x509 1.1.10.
    +2628  * @example
    +2629  * X509.hex2rdn("310a3008060355040a0c0161") → O=a
    +2630  * X509.hex2rdn("31143008060355040a0c01613008060355040a0c0162") → O=a+O=b
     2631  */
    -2632 X509.getPublicKeyFromCertHex = function(h) {
    -2633     var x = new X509();
    -2634     x.readCertHex(h);
    -2635     return x.getPublicKey();
    -2636 };
    +2632 X509.hex2rdn = function(hex, idx) {
    +2633     if (idx === undefined) idx = 0;
    +2634     if (hex.substr(idx, 2) !== "31") throw new Error("malformed RDN");
    +2635 
    +2636     var a = new Array();
     2637 
    -2638 /**
    -2639  * get RSA/DSA/ECDSA public key object from PEM certificate string
    -2640  * @name getPublicKeyFromCertPEM
    -2641  * @memberOf X509
    -2642  * @function
    -2643  * @param {String} sCertPEM PEM formatted RSA/ECDSA/DSA X.509 certificate
    -2644  * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
    -2645  * @since x509 1.1.1
    -2646  * @description
    -2647  * NOTE: DSA is also supported since x509 1.1.2.
    -2648  */
    -2649 X509.getPublicKeyFromCertPEM = function(sCertPEM) {
    -2650     var x = new X509();
    -2651     x.readCertPEM(sCertPEM);
    -2652     return x.getPublicKey();
    -2653 };
    -2654 
    -2655 /**
    -2656  * get public key information from PEM certificate
    -2657  * @name getPublicKeyInfoPropOfCertPEM
    -2658  * @memberOf X509
    -2659  * @function
    -2660  * @param {String} sCertPEM string of PEM formatted certificate
    -2661  * @return {Hash} hash of information for public key
    -2662  * @since x509 1.1.1
    -2663  * @description
    -2664  * Resulted associative array has following properties:<br/>
    -2665  * <ul>
    -2666  * <li>algoid - hexadecimal string of OID of asymmetric key algorithm</li>
    -2667  * <li>algparam - hexadecimal string of OID of ECC curve name or null</li>
    -2668  * <li>keyhex - hexadecimal string of key in the certificate</li>
    -2669  * </ul>
    -2670  * NOTE: X509v1 certificate is also supported since x509.js 1.1.9.
    -2671  */
    -2672 X509.getPublicKeyInfoPropOfCertPEM = function(sCertPEM) {
    -2673     var _ASN1HEX = ASN1HEX;
    -2674     var _getVbyList = _ASN1HEX.getVbyList;
    -2675 
    -2676     var result = {};
    -2677     var x, hSPKI, pubkey;
    -2678     result.algparam = null;
    -2679 
    -2680     x = new X509();
    -2681     x.readCertPEM(sCertPEM);
    -2682 
    -2683     hSPKI = x.getPublicKeyHex();
    -2684     result.keyhex = _getVbyList(hSPKI, 0, [1], "03").substr(2);
    -2685     result.algoid = _getVbyList(hSPKI, 0, [0, 0], "06");
    -2686 
    -2687     if (result.algoid === "2a8648ce3d0201") { // ecPublicKey
    -2688 	result.algparam = _getVbyList(hSPKI, 0, [0, 1], "06");
    -2689     };
    -2690 
    -2691     return result;
    -2692 };
    -2693 
    -2694 /* ======================================================================
    -2695  *   Specific V3 Extensions
    -2696  * ====================================================================== */
    -2697 
    -2698 X509.KEYUSAGE_NAME = [
    -2699     "digitalSignature",
    -2700     "nonRepudiation",
    -2701     "keyEncipherment",
    -2702     "dataEncipherment",
    -2703     "keyAgreement",
    -2704     "keyCertSign",
    -2705     "cRLSign",
    -2706     "encipherOnly",
    -2707     "decipherOnly"
    -2708 ];
    -2709 
    \ No newline at end of file +2638
    var aIdx = ASN1HEX.getChildIdx(hex, idx); +2639 for (var i = 0; i < aIdx.length; i++) { +2640 a.push(X509.hex2attrTypeValue(hex, aIdx[i])); +2641 } +2642 +2643 a = a.map(function(s) { return s.replace("+", "\\+"); }); +2644 return a.join("+"); +2645 }; +2646 +2647 /** +2648 * get string from hexadecimal string of ASN.1 DER AttributeTypeAndValue<br/> +2649 * @name hex2attrTypeValue +2650 * @memberOf X509 +2651 * @function +2652 * @param {String} hex hexadecimal string of ASN.1 DER concludes AttributeTypeAndValue +2653 * @param {Integer} idx index of hexadecimal string (DEFAULT=0) +2654 * @return {String} string representation of AttributeTypeAndValue (ex. C=US) +2655 * @description +2656 * This static method converts from a hexadecimal string of AttributeTypeAndValue +2657 * specified by 'hex' and 'idx' to LDAP string representation (ex. C=US). +2658 * @example +2659 * X509.hex2attrTypeValue("3008060355040a0c0161") → O=a +2660 * X509.hex2attrTypeValue("300806035504060c0161") → C=a +2661 * X509.hex2attrTypeValue("...3008060355040a0c0161...", 128) → O=a +2662 */ +2663 X509.hex2attrTypeValue = function(hex, idx) { +2664 var _ASN1HEX = ASN1HEX; +2665 var _getV = _ASN1HEX.getV; +2666 +2667 if (idx === undefined) idx = 0; +2668 if (hex.substr(idx, 2) !== "30") +2669 throw new Error("malformed attribute type and value"); +2670 +2671 var aIdx = _ASN1HEX.getChildIdx(hex, idx); +2672 if (aIdx.length !== 2 || hex.substr(aIdx[0], 2) !== "06") +2673 "malformed attribute type and value"; +2674 +2675 var oidHex = _getV(hex, aIdx[0]); +2676 var oidInt = KJUR.asn1.ASN1Util.oidHexToInt(oidHex); +2677 var atype = KJUR.asn1.x509.OID.oid2atype(oidInt); +2678 +2679 var hV = _getV(hex, aIdx[1]); +2680 var rawV = hextorstr(hV); +2681 +2682 return atype + "=" + rawV; +2683 }; +2684 +2685 /** +2686 * get RSA/DSA/ECDSA public key object from X.509 certificate hexadecimal string<br/> +2687 * @name getPublicKeyFromCertHex +2688 * @memberOf X509 +2689 * @function +2690 * @param {String} h hexadecimal string of X.509 certificate for RSA/ECDSA/DSA public key +2691 * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key +2692 * @since jsrasign 7.1.0 x509 1.1.11 +2693 */ +2694 X509.getPublicKeyFromCertHex = function(h) { +2695 var x = new X509(); +2696 x.readCertHex(h); +2697 return x.getPublicKey(); +2698 }; +2699 +2700 /** +2701 * get RSA/DSA/ECDSA public key object from PEM certificate string +2702 * @name getPublicKeyFromCertPEM +2703 * @memberOf X509 +2704 * @function +2705 * @param {String} sCertPEM PEM formatted RSA/ECDSA/DSA X.509 certificate +2706 * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key +2707 * @since x509 1.1.1 +2708 * @description +2709 * NOTE: DSA is also supported since x509 1.1.2. +2710 */ +2711 X509.getPublicKeyFromCertPEM = function(sCertPEM) { +2712 var x = new X509(); +2713 x.readCertPEM(sCertPEM); +2714 return x.getPublicKey(); +2715 }; +2716 +2717 /** +2718 * get public key information from PEM certificate +2719 * @name getPublicKeyInfoPropOfCertPEM +2720 * @memberOf X509 +2721 * @function +2722 * @param {String} sCertPEM string of PEM formatted certificate +2723 * @return {Hash} hash of information for public key +2724 * @since x509 1.1.1 +2725 * @description +2726 * Resulted associative array has following properties:<br/> +2727 * <ul> +2728 * <li>algoid - hexadecimal string of OID of asymmetric key algorithm</li> +2729 * <li>algparam - hexadecimal string of OID of ECC curve name or null</li> +2730 * <li>keyhex - hexadecimal string of key in the certificate</li> +2731 * </ul> +2732 * NOTE: X509v1 certificate is also supported since x509.js 1.1.9. +2733 */ +2734 X509.getPublicKeyInfoPropOfCertPEM = function(sCertPEM) { +2735 var _ASN1HEX = ASN1HEX; +2736 var _getVbyList = _ASN1HEX.getVbyList; +2737 +2738 var result = {}; +2739 var x, hSPKI, pubkey; +2740 result.algparam = null; +2741 +2742 x = new X509(); +2743 x.readCertPEM(sCertPEM); +2744 +2745 hSPKI = x.getPublicKeyHex(); +2746 result.keyhex = _getVbyList(hSPKI, 0, [1], "03").substr(2); +2747 result.algoid = _getVbyList(hSPKI, 0, [0, 0], "06"); +2748 +2749 if (result.algoid === "2a8648ce3d0201") { // ecPublicKey +2750 result.algparam = _getVbyList(hSPKI, 0, [0, 1], "06"); +2751 }; +2752 +2753 return result; +2754 }; +2755 +2756 /* ====================================================================== +2757 * Specific V3 Extensions +2758 * ====================================================================== */ +2759 +2760 X509.KEYUSAGE_NAME = [ +2761 "digitalSignature", +2762 "nonRepudiation", +2763 "keyEncipherment", +2764 "dataEncipherment", +2765 "keyAgreement", +2766 "keyCertSign", +2767 "cRLSign", +2768 "encipherOnly", +2769 "decipherOnly" +2770 ]; +2771
    \ No newline at end of file diff --git a/bower.json b/bower.json index 55a4389b..53759738 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "kjur-jsrsasign", - "version": "10.0.0", + "version": "10.0.1", "main": "jsrsasign-all-min.js", "description": "The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES, JWS and JWT in pure JavaScript.", "license": "MIT", diff --git a/jsrsasign-all-min.js b/jsrsasign-all-min.js index ec6251ba..a3f2f5da 100644 --- a/jsrsasign-all-min.js +++ b/jsrsasign-all-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(all) 10.0.0 (2020-09-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(all) 10.0.1 (2020-10-14) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! @@ -225,9 +225,9 @@ ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBi /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval */ 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}})(); -if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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.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.getEncodedHex()}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 '"+hextoutf8(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;u31){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;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e=u*2){break}}var z={};z.keyhex=x.substr(0,i[q]["keylen"]*2);z.ivhex=x.substr(i[q]["keylen"]*2,i[q]["ivlen"]*2);return z};var b=function(p,v,r,w){var s=CryptoJS.enc.Base64.parse(p);var q=CryptoJS.enc.Hex.stringify(s);var u=i[v]["proc"];var t=u(q,r,w);return t};var h=function(p,s,q,u){var r=i[s]["eproc"];var t=r(p,q,u);return t};return{version:"1.0.0",parsePKCS5PEM:function(p){return n(p)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(q,p,r){return j(q,p,r)},decryptKeyB64:function(p,r,q,s){return b(p,r,q,s)},getDecryptedKeyHex:function(y,x){var q=n(y);var t=q.type;var r=q.cipher;var p=q.ivsalt;var s=q.data;var w=j(r,x,p);var v=w.keyhex;var u=b(s,r,v,p);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(x,s,A,t,r){var p="";if(typeof t=="undefined"||t==null){t="AES-256-CBC"}if(typeof i[t]=="undefined"){throw"KEYUTIL unsupported algorithm: "+t}if(typeof r=="undefined"||r==null){var v=i[t]["ivlen"];var u=m(v);r=u.toUpperCase()}var z=j(t,A,r);var y=z.keyhex;var w=h(s,t,y,r);var q=w.replace(/(.{64})/g,"$1\r\n");var p="-----BEGIN "+x+" PRIVATE KEY-----\r\n";p+="Proc-Type: 4,ENCRYPTED\r\n";p+="DEK-Info: "+t+","+r+"\r\n";p+="\r\n";p+=q;p+="\r\n-----END "+x+" PRIVATE KEY-----\r\n";return p},parseHexOfEncryptedPKCS8:function(y){var B=ASN1HEX;var z=B.getChildIdx;var w=B.getV;var t={};var r=z(y,0);if(r.length!=2){throw"malformed format: SEQUENCE(0).items != 2: "+r.length}t.ciphertext=w(y,r[1]);var A=z(y,r[0]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0).items != 2: "+A.length}if(w(y,A[0])!="2a864886f70d01050d"){throw"this only supports pkcs5PBES2"}var p=z(y,A[1]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0.1).items != 2: "+p.length}var q=z(y,p[1]);if(q.length!=2){throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+q.length}if(w(y,q[0])!="2a864886f70d0307"){throw"this only supports TripleDES"}t.encryptionSchemeAlg="TripleDES";t.encryptionSchemeIV=w(y,q[1]);var s=z(y,p[0]);if(s.length!=2){throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+s.length}if(w(y,s[0])!="2a864886f70d01050c"){throw"this only supports pkcs5PBKDF2"}var x=z(y,s[1]);if(x.length<2){throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+x.length}t.pbkdf2Salt=w(y,x[0]);var u=w(y,x[1]);try{t.pbkdf2Iter=parseInt(u,16)}catch(v){throw"malformed format pbkdf2Iter: "+u}return t},getPBKDF2KeyHexFromParam:function(u,p){var t=CryptoJS.enc.Hex.parse(u.pbkdf2Salt);var q=u.pbkdf2Iter;var s=CryptoJS.PBKDF2(p,t,{keySize:192/32,iterations:q});var r=CryptoJS.enc.Hex.stringify(s);return r},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(x,y){var r=pemtohex(x,"ENCRYPTED PRIVATE KEY");var p=this.parseHexOfEncryptedPKCS8(r);var u=KEYUTIL.getPBKDF2KeyHexFromParam(p,y);var v={};v.ciphertext=CryptoJS.enc.Hex.parse(p.ciphertext);var t=CryptoJS.enc.Hex.parse(u);var s=CryptoJS.enc.Hex.parse(p.encryptionSchemeIV);var w=CryptoJS.TripleDES.decrypt(v,t,{iv:s});var q=CryptoJS.enc.Hex.stringify(w);return q},getKeyFromEncryptedPKCS8PEM:function(s,q){var p=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s,q);var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},parsePlainPrivatePKCS8Hex:function(s){var v=ASN1HEX;var u=v.getChildIdx;var t=v.getV;var q={};q.algparam=null;if(s.substr(0,2)!="30"){throw"malformed plain PKCS8 private key(code:001)"}var r=u(s,0);if(r.length!=3){throw"malformed plain PKCS8 private key(code:002)"}if(s.substr(r[1],2)!="30"){throw"malformed PKCS8 private key(code:003)"}var p=u(s,r[1]);if(p.length!=2){throw"malformed PKCS8 private key(code:004)"}if(s.substr(p[0],2)!="06"){throw"malformed PKCS8 private key(code:005)"}q.algoid=t(s,p[0]);if(s.substr(p[1],2)=="06"){q.algparam=t(s,p[1])}if(s.substr(r[2],2)!="04"){throw"malformed PKCS8 private key(code:006)"}q.keyidx=v.getVidx(s,r[2]);return q},getKeyFromPlainPrivatePKCS8PEM:function(q){var p=pemtohex(q,"PRIVATE KEY");var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},getKeyFromPlainPrivatePKCS8Hex:function(p){var q=this.parsePlainPrivatePKCS8Hex(p);var r;if(q.algoid=="2a864886f70d010101"){r=new RSAKey()}else{if(q.algoid=="2a8648ce380401"){r=new KJUR.crypto.DSA()}else{if(q.algoid=="2a8648ce3d0201"){r=new KJUR.crypto.ECDSA()}else{throw"unsupported private key algorithm"}}}r.readPKCS8PrvKeyHex(p);return r},_getKeyFromPublicPKCS8Hex:function(q){var p;var r=ASN1HEX.getVbyList(q,0,[0,0],"06");if(r==="2a864886f70d010101"){p=new RSAKey()}else{if(r==="2a8648ce380401"){p=new KJUR.crypto.DSA()}else{if(r==="2a8648ce3d0201"){p=new KJUR.crypto.ECDSA()}else{throw"unsupported PKCS#8 public key hex"}}}p.readPKCS8PubKeyHex(q);return p},parsePublicRawRSAKeyHex:function(r){var u=ASN1HEX;var t=u.getChildIdx;var s=u.getV;var p={};if(r.substr(0,2)!="30"){throw"malformed RSA key(code:001)"}var q=t(r,0);if(q.length!=2){throw"malformed RSA key(code:002)"}if(r.substr(q[0],2)!="02"){throw"malformed RSA key(code:003)"}p.n=s(r,q[0]);if(r.substr(q[1],2)!="02"){throw"malformed RSA key(code:004)"}p.e=s(r,q[1]);return p},parsePublicPKCS8Hex:function(t){var v=ASN1HEX;var u=v.getChildIdx;var s=v.getV;var q={};q.algparam=null;var r=u(t,0);if(r.length!=2){throw"outer DERSequence shall have 2 elements: "+r.length}var w=r[0];if(t.substr(w,2)!="30"){throw"malformed PKCS8 public key(code:001)"}var p=u(t,w);if(p.length!=2){throw"malformed PKCS8 public key(code:002)"}if(t.substr(p[0],2)!="06"){throw"malformed PKCS8 public key(code:003)"}q.algoid=s(t,p[0]);if(t.substr(p[1],2)=="06"){q.algparam=s(t,p[1])}else{if(t.substr(p[1],2)=="30"){q.algparam={};q.algparam.p=v.getVbyList(t,p[1],[0],"02");q.algparam.q=v.getVbyList(t,p[1],[1],"02");q.algparam.g=v.getVbyList(t,p[1],[2],"02")}}if(t.substr(r[1],2)!="03"){throw"malformed PKCS8 public key(code:004)"}q.key=s(t,r[1]).substr(2);return q},}}();KEYUTIL.getKey=function(l,k,n){var G=ASN1HEX,L=G.getChildIdx,v=G.getV,d=G.getVbyList,c=KJUR.crypto,i=c.ECDSA,C=c.DSA,w=RSAKey,M=pemtohex,F=KEYUTIL;if(typeof w!="undefined"&&l instanceof w){return l}if(typeof i!="undefined"&&l instanceof i){return l}if(typeof C!="undefined"&&l instanceof C){return l}if(l.curve!==undefined&&l.xy!==undefined&&l.d===undefined){return new i({pub:l.xy,curve:l.curve})}if(l.curve!==undefined&&l.d!==undefined){return new i({prv:l.d,curve:l.curve})}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(l.n,l.e);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.co!==undefined&&l.qi===undefined){var P=new w();P.setPrivateEx(l.n,l.e,l.d,l.p,l.q,l.dp,l.dq,l.co);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p===undefined){var P=new w();P.setPrivate(l.n,l.e,l.d);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x===undefined){var P=new C();P.setPublic(l.p,l.q,l.g,l.y);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x!==undefined){var P=new C();P.setPrivate(l.p,l.q,l.g,l.y,l.x);return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(b64utohex(l.n),b64utohex(l.e));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.qi!==undefined){var P=new w();P.setPrivateEx(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d),b64utohex(l.p),b64utohex(l.q),b64utohex(l.dp),b64utohex(l.dq),b64utohex(l.qi));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined){var P=new w();P.setPrivate(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d));return P}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d===undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;j.setPublicKeyHex(u);return j}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d!==undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;var b=("0000000000"+b64utohex(l.d)).slice(-t);j.setPublicKeyHex(u);j.setPrivateKeyHex(b);return j}if(n==="pkcs5prv"){var J=l,G=ASN1HEX,N,P;N=L(J,0);if(N.length===9){P=new w();P.readPKCS5PrvKeyHex(J)}else{if(N.length===6){P=new C();P.readPKCS5PrvKeyHex(J)}else{if(N.length>2&&J.substr(N[1],2)==="04"){P=new i();P.readPKCS5PrvKeyHex(J)}else{throw"unsupported PKCS#1/5 hexadecimal key"}}}return P}if(n==="pkcs8prv"){var P=F.getKeyFromPlainPrivatePKCS8Hex(l);return P}if(n==="pkcs8pub"){return F._getKeyFromPublicPKCS8Hex(l)}if(n==="x509pub"){return X509.getPublicKeyFromCertHex(l)}if(l.indexOf("-END CERTIFICATE-",0)!=-1||l.indexOf("-END X509 CERTIFICATE-",0)!=-1||l.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1){return X509.getPublicKeyFromCertPEM(l)}if(l.indexOf("-END PUBLIC KEY-")!=-1){var O=pemtohex(l,"PUBLIC KEY");return F._getKeyFromPublicPKCS8Hex(O)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"RSA PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var I=M(l,"DSA PRIVATE KEY");var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"EC PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END PRIVATE KEY-")!=-1){return F.getKeyFromPlainPrivatePKCS8PEM(l)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var o=F.getDecryptedKeyHex(l,k);var H=new RSAKey();H.readPKCS5PrvKeyHex(o);return H}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var P=d(I,0,[1],"04");var f=d(I,0,[2,0],"06");var A=d(I,0,[3,0],"03").substr(2);var e="";if(KJUR.crypto.OID.oidhex2name[f]!==undefined){e=KJUR.crypto.OID.oidhex2name[f]}else{throw"undefined OID(hex) in KJUR.crypto.OID: "+f}var j=new i({curve:e});j.setPublicKeyHex(A);j.setPrivateKeyHex(P);j.isPublic=false;return j}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1){return F.getKeyFromEncryptedPKCS8PEM(l,k)}throw new Error("not supported argument")};KEYUTIL.generateKeypair=function(a,c){if(a=="RSA"){var b=c;var h=new RSAKey();h.generate(b,"10001");h.isPrivate=true;h.isPublic=true;var f=new RSAKey();var e=h.n.toString(16);var i=h.e.toString(16);f.setPublic(e,i);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{if(a=="EC"){var d=c;var g=new KJUR.crypto.ECDSA({curve:d});var j=g.generateKeyPairHex();var h=new KJUR.crypto.ECDSA({curve:d});h.setPublicKeyHex(j.ecpubhex);h.setPrivateKeyHex(j.ecprvhex);h.isPrivate=true;h.isPublic=false;var f=new KJUR.crypto.ECDSA({curve:d});f.setPublicKeyHex(j.ecpubhex);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{throw"unknown algorithm: "+a}}};KEYUTIL.getPEM=function(b,D,y,m,q,j){var F=KJUR,k=F.asn1,z=k.DERObjectIdentifier,f=k.DERInteger,l=k.ASN1Util.newObject,a=k.x509,C=a.SubjectPublicKeyInfo,e=F.crypto,u=e.DSA,r=e.ECDSA,n=RSAKey;function A(s){var G=l({seq:[{"int":0},{"int":{bigint:s.n}},{"int":s.e},{"int":{bigint:s.d}},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.dmp1}},{"int":{bigint:s.dmq1}},{"int":{bigint:s.coeff}}]});return G}function B(G){var s=l({seq:[{"int":1},{octstr:{hex:G.prvKeyHex}},{tag:["a0",true,{oid:{name:G.curveName}}]},{tag:["a1",true,{bitstr:{hex:"00"+G.pubKeyHex}}]}]});return s}function x(s){var G=l({seq:[{"int":0},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.g}},{"int":{bigint:s.y}},{"int":{bigint:s.x}}]});return G}if(((n!==undefined&&b instanceof n)||(u!==undefined&&b instanceof u)||(r!==undefined&&b instanceof r))&&b.isPublic==true&&(D===undefined||D=="PKCS8PUB")){var E=new C(b);var w=E.getEncodedHex();return hextopem(w,"PUBLIC KEY")}if(D=="PKCS1PRV"&&n!==undefined&&b instanceof n&&(y===undefined||y==null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();return hextopem(w,"RSA PRIVATE KEY")}if(D=="PKCS1PRV"&&r!==undefined&&b instanceof r&&(y===undefined||y==null)&&b.isPrivate==true){var i=new z({name:b.curveName});var v=i.getEncodedHex();var h=B(b);var t=h.getEncodedHex();var p="";p+=hextopem(v,"EC PARAMETERS");p+=hextopem(t,"EC PRIVATE KEY");return p}if(D=="PKCS1PRV"&&u!==undefined&&b instanceof u&&(y===undefined||y==null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();return hextopem(w,"DSA PRIVATE KEY")}if(D=="PKCS5PRV"&&n!==undefined&&b instanceof n&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,y,m,j)}if(D=="PKCS5PRV"&&r!==undefined&&b instanceof r&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=B(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,y,m,j)}if(D=="PKCS5PRV"&&u!==undefined&&b instanceof u&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,y,m,j)}var o=function(G,s){var I=c(G,s);var H=new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:I.pbkdf2Salt}},{"int":I.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:I.encryptionSchemeIV}}]}]}]},{octstr:{hex:I.ciphertext}}]});return H.getEncodedHex()};var c=function(N,O){var H=100;var M=CryptoJS.lib.WordArray.random(8);var L="DES-EDE3-CBC";var s=CryptoJS.lib.WordArray.random(8);var I=CryptoJS.PBKDF2(O,M,{keySize:192/32,iterations:H});var J=CryptoJS.enc.Hex.parse(N);var K=CryptoJS.TripleDES.encrypt(J,I,{iv:s})+"";var G={};G.ciphertext=K;G.pbkdf2Salt=CryptoJS.enc.Hex.stringify(M);G.pbkdf2Iter=H;G.encryptionSchemeAlg=L;G.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s);return G};if(D=="PKCS8PRV"&&n!=undefined&&b instanceof n&&b.isPrivate==true){var g=A(b);var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"rsaEncryption"}},{"null":true}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&r!==undefined&&b instanceof r&&b.isPrivate==true){var g=new l({seq:[{"int":1},{octstr:{hex:b.prvKeyHex}},{tag:["a1",true,{bitstr:{hex:"00"+b.pubKeyHex}}]}]});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:b.curveName}}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&u!==undefined&&b instanceof u&&b.isPrivate==true){var g=new f({bigint:b.x});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"dsa"}},{seq:[{"int":{bigint:b.p}},{"int":{bigint:b.q}},{"int":{bigint:b.g}}]}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}throw new Error("unsupported object nor format")};KEYUTIL.getKeyFromCSRPEM=function(b){var a=pemtohex(b,"CERTIFICATE REQUEST");var c=KEYUTIL.getKeyFromCSRHex(a);return c};KEYUTIL.getKeyFromCSRHex=function(a){var c=KEYUTIL.parseCSRHex(a);var b=KEYUTIL.getKey(c.p8pubkeyhex,null,"pkcs8pub");return b};KEYUTIL.parseCSRHex=function(d){var i=ASN1HEX;var f=i.getChildIdx;var c=i.getTLV;var b={};var g=d;if(g.substr(0,2)!="30"){throw"malformed CSR(code:001)"}var e=f(g,0);if(e.length<1){throw"malformed CSR(code:002)"}if(g.substr(e[0],2)!="30"){throw"malformed CSR(code:003)"}var a=f(g,e[0]);if(a.length<3){throw"malformed CSR(code:004)"}b.p8pubkeyhex=c(g,a[2]);return b};KEYUTIL.getKeyID=function(f){var c=KEYUTIL;var e=ASN1HEX;if(typeof f==="string"&&f.indexOf("BEGIN ")!=-1){f=c.getKey(f)}var d=pemtohex(c.getPEM(f));var b=e.getIdxbyList(d,0,[1]);var a=e.getV(d,b).substring(2);return KJUR.crypto.Util.hashHex(a,"sha1")};KEYUTIL.getJWKFromKey=function(d){var b={};if(d instanceof RSAKey&&d.isPrivate){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));b.d=hextob64u(d.d.toString(16));b.p=hextob64u(d.p.toString(16));b.q=hextob64u(d.q.toString(16));b.dp=hextob64u(d.dmp1.toString(16));b.dq=hextob64u(d.dmq1.toString(16));b.qi=hextob64u(d.coeff.toString(16));return b}else{if(d instanceof RSAKey&&d.isPublic){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPrivate){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);b.d=hextob64u(d.prvKeyHex);return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPublic){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);return b}}}}throw"not supported key object"}; RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)};RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var n=ASN1HEX;var i=n.getV;var k=RSAKey.getPosArrayOfChildrenFromHex(f);var e=i(f,k[0]);var j=i(f,k[1]);var b=i(f,k[2]);var c=i(f,k[3]);var h=i(f,k[4]);var g=i(f,k[5]);var m=i(f,k[6]);var l=i(f,k[7]);var d=i(f,k[8]);var k=new Array();k.push(e,j,b,c,h,g,m,l,d);return k};RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d);var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,i,k,b,a,f,d,j;var m=ASN1HEX;var l=m.getVbyListEx;if(m.isASN1HEX(e)===false){throw new Error("not ASN.1 hex string")}try{c=l(e,0,[2,0,1],"02");i=l(e,0,[2,0,2],"02");k=l(e,0,[2,0,3],"02");b=l(e,0,[2,0,4],"02");a=l(e,0,[2,0,5],"02");f=l(e,0,[2,0,6],"02");d=l(e,0,[2,0,7],"02");j=l(e,0,[2,0,8],"02")}catch(g){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(c,i,k,b,a,f,d,j)};RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX;var b=e.getV;if(e.isASN1HEX(c)===false){throw new Error("keyHex is not ASN.1 hex string")}var a=e.getChildIdx(c,0);if(a.length!==2||c.substr(a[0],2)!=="02"||c.substr(a[1],2)!=="02"){throw new Error("wrong hex for PKCS#5 public key")}var f=b(c,a[0]);var d=b(c,a[1]);this.setPublic(f,d)};RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(c.isASN1HEX(b)===false){throw new Error("not ASN.1 hex string")}if(c.getTLVbyListEx(b,0,[0,0])!=="06092a864886f70d010101"){throw new Error("not PKCS8 RSA public key")}var a=c.getTLVbyListEx(b,0,[1,0]);this.readPKCS5PubKeyHex(a)};RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;a=new X509();a.readCertHex(b);c=a.getPublicKeyHex();this.readPKCS8PubKeyHex(c)}; var _RE_HEXDECONLY=new RegExp("[^0-9a-f]","gi");function _rsasign_getHexPaddedDigestInfoForString(d,e,a){var b=function(f){return KJUR.crypto.Util.hashString(f,a)};var c=b(d);return KJUR.crypto.Util.getPaddedDigestInfoHex(c,a,e)}function _zeroPaddingOfSignature(e,d){var c="";var a=d/4-e.length;for(var b=0;b>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;dthis.n.bitLength()){return 0}var i=this.doPublic(b);var e=i.toString(16).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(k){return KJUR.crypto.Util.hashString(k,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;q0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w1){var z=b(v,u[1]);var t=this.getGeneraName(z);if(t.uri!=undefined){s.uri=t.uri}}if(u.length>2){var w=b(v,u[2]);if(w=="0101ff"){s.reqauth=true}if(w=="010100"){s.reqauth=false}}return s};this.getX500NameRule=function(s){var z=true;var D=true;var C=false;var t="";var w="";var F=null;var A=[];for(var v=0;v0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w0){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;var k=e.split(".");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.gracePeriodl){this.aHeader.pop()}if(this.aSignature.length>l){this.aSignature.pop()}throw"addSignature failed: "+i}};this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length){return false}for(var g=0;g0){this.aHeader=g.headers}else{throw"malformed header"}if(typeof g.payload==="string"){this.sPayload=g.payload}else{throw"malformed signatures"}if(g.signatures.length>0){this.aSignature=g.signatures}else{throw"malformed signatures"}}catch(e){throw"malformed JWS-JS JSON object: "+e}}};this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}};this.isEmpty=function(){if(this.aHeader.length==0){return 1}return 0}}; diff --git a/jsrsasign-jwths-min.js b/jsrsasign-jwths-min.js index 76a73e71..240cbb65 100644 --- a/jsrsasign-jwths-min.js +++ b/jsrsasign-jwths-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(jwths) 10.0.0 (2020-09-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(jwths) 10.0.1 (2020-10-14) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! diff --git a/jsrsasign-rsa-min.js b/jsrsasign-rsa-min.js index 36c50307..b330ecc7 100644 --- a/jsrsasign-rsa-min.js +++ b/jsrsasign-rsa-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(rsa) 10.0.0 (2020-09-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(rsa) 10.0.1 (2020-10-14) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! @@ -98,7 +98,7 @@ function parseBigInt(b,a){return new BigInteger(b,a)}function linebrk(c,d){var a /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f=a.length){return null}}var e="";while(++f191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}function oaep_mgf1_str(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255]));d+=1}return b}function oaep_unpad(o,b,g,p){var e=KJUR.crypto.MessageDigest;var r=KJUR.crypto.Util;var c=null;if(!g){g="sha1"}if(typeof g==="string"){c=e.getCanonicalAlgName(g);p=e.getHashLength(c);g=function(d){return hextorstr(r.hashHex(rstrtohex(d),c))}}o=o.toByteArray();var h;for(h=0;h0&&a.length>0){this.n=parseBigInt(c,16);this.e=parseInt(a,16);this.d=parseBigInt(b,16)}else{throw"Invalid RSA private key"}}}function RSASetPrivateEx(g,d,e,c,b,a,h,f){this.isPrivate=true;this.isPublic=false;if(g==null){throw"RSASetPrivateEx N == null"}if(d==null){throw"RSASetPrivateEx E == null"}if(g.length==0){throw"RSASetPrivateEx N.length == 0"}if(d.length==0){throw"RSASetPrivateEx E.length == 0"}if(g!=null&&d!=null&&g.length>0&&d.length>0){this.n=parseBigInt(g,16);this.e=parseInt(d,16);this.d=parseBigInt(e,16);this.p=parseBigInt(c,16);this.q=parseBigInt(b,16);this.dmp1=parseBigInt(a,16);this.dmq1=parseBigInt(h,16);this.coeff=parseBigInt(f,16)}else{throw"Invalid RSA private key in RSASetPrivateEx"}}function RSAGenerate(b,i){var a=new SecureRandom();var f=b>>1;this.e=parseInt(i,16);var c=new BigInteger(i,16);for(;;){for(;;){this.p=new BigInteger(b-f,1,a);if(this.p.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new BigInteger(f,1,a);if(this.q.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var h=this.p;this.p=this.q;this.q=h}var g=this.p.subtract(BigInteger.ONE);var d=this.q.subtract(BigInteger.ONE);var e=g.multiply(d);if(e.gcd(c).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);if(this.n.bitLength()==b){this.d=c.modInverse(e);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(d);this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=true}function RSADoPrivate(a){if(this.p==null||this.q==null){return a.modPow(this.d,this.n)}var c=a.mod(this.p).modPow(this.dmp1,this.p);var b=a.mod(this.q).modPow(this.dmq1,this.q);while(c.compareTo(b)<0){c=c.add(this.p)}return c.subtract(b).multiply(this.coeff).mod(this.p).multiply(this.q).add(b)}function RSADecrypt(b){if(b.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var d=parseBigInt(b,16);var a=this.doPrivate(d);if(a==null){return null}return pkcs1unpad2(a,(this.n.bitLength()+7)>>3)}function RSADecryptOAEP(e,d,b){if(e.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var f=parseBigInt(e,16);var a=this.doPrivate(f);if(a==null){return null}return oaep_unpad(a,(this.n.bitLength()+7)>>3,d,b)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate;RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;RSAKey.prototype.decryptOAEP=RSADecryptOAEP; -if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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.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.getEncodedHex()}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 '"+hextoutf8(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;u31){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;ef.length){f=c[d]}}e=e.replace(f,"::");return e.slice(1,-1)}function hextoip(b){var d="malformed hex value";if(!b.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){throw d}if(b.length==8){var c;try{c=parseInt(b.substr(0,2),16)+"."+parseInt(b.substr(2,2),16)+"."+parseInt(b.substr(4,2),16)+"."+parseInt(b.substr(6,2),16);return c}catch(a){throw d}}else{if(b.length==32){return hextoipv6(b)}else{return b}}}function iptohex(f){var j="malformed IP address";f=f.toLowerCase(f);if(f.match(/^[0-9.]+$/)){var b=f.split(".");if(b.length!==4){throw j}var g="";try{for(var e=0;e<4;e++){var h=parseInt(b[e]);g+=("0"+h.toString(16)).slice(-2)}return g}catch(c){throw j}}else{if(f.match(/^[0-9a-f:]+$/)&&f.indexOf(":")!==-1){return ipv6tohex(f)}else{throw j}}}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;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;f15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||70){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w1){var z=b(v,u[1]);var t=this.getGeneraName(z);if(t.uri!=undefined){s.uri=t.uri}}if(u.length>2){var w=b(v,u[2]);if(w=="0101ff"){s.reqauth=true}if(w=="010100"){s.reqauth=false}}return s};this.getX500NameRule=function(s){var z=true;var D=true;var C=false;var t="";var w="";var F=null;var A=[];for(var v=0;v0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); -if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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.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.getEncodedHex()}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 '"+hextoutf8(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;u31){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;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e=u*2){break}}var z={};z.keyhex=x.substr(0,i[q]["keylen"]*2);z.ivhex=x.substr(i[q]["keylen"]*2,i[q]["ivlen"]*2);return z};var b=function(p,v,r,w){var s=CryptoJS.enc.Base64.parse(p);var q=CryptoJS.enc.Hex.stringify(s);var u=i[v]["proc"];var t=u(q,r,w);return t};var h=function(p,s,q,u){var r=i[s]["eproc"];var t=r(p,q,u);return t};return{version:"1.0.0",parsePKCS5PEM:function(p){return n(p)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(q,p,r){return j(q,p,r)},decryptKeyB64:function(p,r,q,s){return b(p,r,q,s)},getDecryptedKeyHex:function(y,x){var q=n(y);var t=q.type;var r=q.cipher;var p=q.ivsalt;var s=q.data;var w=j(r,x,p);var v=w.keyhex;var u=b(s,r,v,p);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(x,s,A,t,r){var p="";if(typeof t=="undefined"||t==null){t="AES-256-CBC"}if(typeof i[t]=="undefined"){throw"KEYUTIL unsupported algorithm: "+t}if(typeof r=="undefined"||r==null){var v=i[t]["ivlen"];var u=m(v);r=u.toUpperCase()}var z=j(t,A,r);var y=z.keyhex;var w=h(s,t,y,r);var q=w.replace(/(.{64})/g,"$1\r\n");var p="-----BEGIN "+x+" PRIVATE KEY-----\r\n";p+="Proc-Type: 4,ENCRYPTED\r\n";p+="DEK-Info: "+t+","+r+"\r\n";p+="\r\n";p+=q;p+="\r\n-----END "+x+" PRIVATE KEY-----\r\n";return p},parseHexOfEncryptedPKCS8:function(y){var B=ASN1HEX;var z=B.getChildIdx;var w=B.getV;var t={};var r=z(y,0);if(r.length!=2){throw"malformed format: SEQUENCE(0).items != 2: "+r.length}t.ciphertext=w(y,r[1]);var A=z(y,r[0]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0).items != 2: "+A.length}if(w(y,A[0])!="2a864886f70d01050d"){throw"this only supports pkcs5PBES2"}var p=z(y,A[1]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0.1).items != 2: "+p.length}var q=z(y,p[1]);if(q.length!=2){throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+q.length}if(w(y,q[0])!="2a864886f70d0307"){throw"this only supports TripleDES"}t.encryptionSchemeAlg="TripleDES";t.encryptionSchemeIV=w(y,q[1]);var s=z(y,p[0]);if(s.length!=2){throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+s.length}if(w(y,s[0])!="2a864886f70d01050c"){throw"this only supports pkcs5PBKDF2"}var x=z(y,s[1]);if(x.length<2){throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+x.length}t.pbkdf2Salt=w(y,x[0]);var u=w(y,x[1]);try{t.pbkdf2Iter=parseInt(u,16)}catch(v){throw"malformed format pbkdf2Iter: "+u}return t},getPBKDF2KeyHexFromParam:function(u,p){var t=CryptoJS.enc.Hex.parse(u.pbkdf2Salt);var q=u.pbkdf2Iter;var s=CryptoJS.PBKDF2(p,t,{keySize:192/32,iterations:q});var r=CryptoJS.enc.Hex.stringify(s);return r},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(x,y){var r=pemtohex(x,"ENCRYPTED PRIVATE KEY");var p=this.parseHexOfEncryptedPKCS8(r);var u=KEYUTIL.getPBKDF2KeyHexFromParam(p,y);var v={};v.ciphertext=CryptoJS.enc.Hex.parse(p.ciphertext);var t=CryptoJS.enc.Hex.parse(u);var s=CryptoJS.enc.Hex.parse(p.encryptionSchemeIV);var w=CryptoJS.TripleDES.decrypt(v,t,{iv:s});var q=CryptoJS.enc.Hex.stringify(w);return q},getKeyFromEncryptedPKCS8PEM:function(s,q){var p=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s,q);var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},parsePlainPrivatePKCS8Hex:function(s){var v=ASN1HEX;var u=v.getChildIdx;var t=v.getV;var q={};q.algparam=null;if(s.substr(0,2)!="30"){throw"malformed plain PKCS8 private key(code:001)"}var r=u(s,0);if(r.length!=3){throw"malformed plain PKCS8 private key(code:002)"}if(s.substr(r[1],2)!="30"){throw"malformed PKCS8 private key(code:003)"}var p=u(s,r[1]);if(p.length!=2){throw"malformed PKCS8 private key(code:004)"}if(s.substr(p[0],2)!="06"){throw"malformed PKCS8 private key(code:005)"}q.algoid=t(s,p[0]);if(s.substr(p[1],2)=="06"){q.algparam=t(s,p[1])}if(s.substr(r[2],2)!="04"){throw"malformed PKCS8 private key(code:006)"}q.keyidx=v.getVidx(s,r[2]);return q},getKeyFromPlainPrivatePKCS8PEM:function(q){var p=pemtohex(q,"PRIVATE KEY");var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},getKeyFromPlainPrivatePKCS8Hex:function(p){var q=this.parsePlainPrivatePKCS8Hex(p);var r;if(q.algoid=="2a864886f70d010101"){r=new RSAKey()}else{if(q.algoid=="2a8648ce380401"){r=new KJUR.crypto.DSA()}else{if(q.algoid=="2a8648ce3d0201"){r=new KJUR.crypto.ECDSA()}else{throw"unsupported private key algorithm"}}}r.readPKCS8PrvKeyHex(p);return r},_getKeyFromPublicPKCS8Hex:function(q){var p;var r=ASN1HEX.getVbyList(q,0,[0,0],"06");if(r==="2a864886f70d010101"){p=new RSAKey()}else{if(r==="2a8648ce380401"){p=new KJUR.crypto.DSA()}else{if(r==="2a8648ce3d0201"){p=new KJUR.crypto.ECDSA()}else{throw"unsupported PKCS#8 public key hex"}}}p.readPKCS8PubKeyHex(q);return p},parsePublicRawRSAKeyHex:function(r){var u=ASN1HEX;var t=u.getChildIdx;var s=u.getV;var p={};if(r.substr(0,2)!="30"){throw"malformed RSA key(code:001)"}var q=t(r,0);if(q.length!=2){throw"malformed RSA key(code:002)"}if(r.substr(q[0],2)!="02"){throw"malformed RSA key(code:003)"}p.n=s(r,q[0]);if(r.substr(q[1],2)!="02"){throw"malformed RSA key(code:004)"}p.e=s(r,q[1]);return p},parsePublicPKCS8Hex:function(t){var v=ASN1HEX;var u=v.getChildIdx;var s=v.getV;var q={};q.algparam=null;var r=u(t,0);if(r.length!=2){throw"outer DERSequence shall have 2 elements: "+r.length}var w=r[0];if(t.substr(w,2)!="30"){throw"malformed PKCS8 public key(code:001)"}var p=u(t,w);if(p.length!=2){throw"malformed PKCS8 public key(code:002)"}if(t.substr(p[0],2)!="06"){throw"malformed PKCS8 public key(code:003)"}q.algoid=s(t,p[0]);if(t.substr(p[1],2)=="06"){q.algparam=s(t,p[1])}else{if(t.substr(p[1],2)=="30"){q.algparam={};q.algparam.p=v.getVbyList(t,p[1],[0],"02");q.algparam.q=v.getVbyList(t,p[1],[1],"02");q.algparam.g=v.getVbyList(t,p[1],[2],"02")}}if(t.substr(r[1],2)!="03"){throw"malformed PKCS8 public key(code:004)"}q.key=s(t,r[1]).substr(2);return q},}}();KEYUTIL.getKey=function(l,k,n){var G=ASN1HEX,L=G.getChildIdx,v=G.getV,d=G.getVbyList,c=KJUR.crypto,i=c.ECDSA,C=c.DSA,w=RSAKey,M=pemtohex,F=KEYUTIL;if(typeof w!="undefined"&&l instanceof w){return l}if(typeof i!="undefined"&&l instanceof i){return l}if(typeof C!="undefined"&&l instanceof C){return l}if(l.curve!==undefined&&l.xy!==undefined&&l.d===undefined){return new i({pub:l.xy,curve:l.curve})}if(l.curve!==undefined&&l.d!==undefined){return new i({prv:l.d,curve:l.curve})}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(l.n,l.e);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.co!==undefined&&l.qi===undefined){var P=new w();P.setPrivateEx(l.n,l.e,l.d,l.p,l.q,l.dp,l.dq,l.co);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p===undefined){var P=new w();P.setPrivate(l.n,l.e,l.d);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x===undefined){var P=new C();P.setPublic(l.p,l.q,l.g,l.y);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x!==undefined){var P=new C();P.setPrivate(l.p,l.q,l.g,l.y,l.x);return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(b64utohex(l.n),b64utohex(l.e));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.qi!==undefined){var P=new w();P.setPrivateEx(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d),b64utohex(l.p),b64utohex(l.q),b64utohex(l.dp),b64utohex(l.dq),b64utohex(l.qi));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined){var P=new w();P.setPrivate(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d));return P}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d===undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;j.setPublicKeyHex(u);return j}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d!==undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;var b=("0000000000"+b64utohex(l.d)).slice(-t);j.setPublicKeyHex(u);j.setPrivateKeyHex(b);return j}if(n==="pkcs5prv"){var J=l,G=ASN1HEX,N,P;N=L(J,0);if(N.length===9){P=new w();P.readPKCS5PrvKeyHex(J)}else{if(N.length===6){P=new C();P.readPKCS5PrvKeyHex(J)}else{if(N.length>2&&J.substr(N[1],2)==="04"){P=new i();P.readPKCS5PrvKeyHex(J)}else{throw"unsupported PKCS#1/5 hexadecimal key"}}}return P}if(n==="pkcs8prv"){var P=F.getKeyFromPlainPrivatePKCS8Hex(l);return P}if(n==="pkcs8pub"){return F._getKeyFromPublicPKCS8Hex(l)}if(n==="x509pub"){return X509.getPublicKeyFromCertHex(l)}if(l.indexOf("-END CERTIFICATE-",0)!=-1||l.indexOf("-END X509 CERTIFICATE-",0)!=-1||l.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1){return X509.getPublicKeyFromCertPEM(l)}if(l.indexOf("-END PUBLIC KEY-")!=-1){var O=pemtohex(l,"PUBLIC KEY");return F._getKeyFromPublicPKCS8Hex(O)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"RSA PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var I=M(l,"DSA PRIVATE KEY");var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"EC PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END PRIVATE KEY-")!=-1){return F.getKeyFromPlainPrivatePKCS8PEM(l)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var o=F.getDecryptedKeyHex(l,k);var H=new RSAKey();H.readPKCS5PrvKeyHex(o);return H}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var P=d(I,0,[1],"04");var f=d(I,0,[2,0],"06");var A=d(I,0,[3,0],"03").substr(2);var e="";if(KJUR.crypto.OID.oidhex2name[f]!==undefined){e=KJUR.crypto.OID.oidhex2name[f]}else{throw"undefined OID(hex) in KJUR.crypto.OID: "+f}var j=new i({curve:e});j.setPublicKeyHex(A);j.setPrivateKeyHex(P);j.isPublic=false;return j}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1){return F.getKeyFromEncryptedPKCS8PEM(l,k)}throw new Error("not supported argument")};KEYUTIL.generateKeypair=function(a,c){if(a=="RSA"){var b=c;var h=new RSAKey();h.generate(b,"10001");h.isPrivate=true;h.isPublic=true;var f=new RSAKey();var e=h.n.toString(16);var i=h.e.toString(16);f.setPublic(e,i);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{if(a=="EC"){var d=c;var g=new KJUR.crypto.ECDSA({curve:d});var j=g.generateKeyPairHex();var h=new KJUR.crypto.ECDSA({curve:d});h.setPublicKeyHex(j.ecpubhex);h.setPrivateKeyHex(j.ecprvhex);h.isPrivate=true;h.isPublic=false;var f=new KJUR.crypto.ECDSA({curve:d});f.setPublicKeyHex(j.ecpubhex);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{throw"unknown algorithm: "+a}}};KEYUTIL.getPEM=function(b,D,y,m,q,j){var F=KJUR,k=F.asn1,z=k.DERObjectIdentifier,f=k.DERInteger,l=k.ASN1Util.newObject,a=k.x509,C=a.SubjectPublicKeyInfo,e=F.crypto,u=e.DSA,r=e.ECDSA,n=RSAKey;function A(s){var G=l({seq:[{"int":0},{"int":{bigint:s.n}},{"int":s.e},{"int":{bigint:s.d}},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.dmp1}},{"int":{bigint:s.dmq1}},{"int":{bigint:s.coeff}}]});return G}function B(G){var s=l({seq:[{"int":1},{octstr:{hex:G.prvKeyHex}},{tag:["a0",true,{oid:{name:G.curveName}}]},{tag:["a1",true,{bitstr:{hex:"00"+G.pubKeyHex}}]}]});return s}function x(s){var G=l({seq:[{"int":0},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.g}},{"int":{bigint:s.y}},{"int":{bigint:s.x}}]});return G}if(((n!==undefined&&b instanceof n)||(u!==undefined&&b instanceof u)||(r!==undefined&&b instanceof r))&&b.isPublic==true&&(D===undefined||D=="PKCS8PUB")){var E=new C(b);var w=E.getEncodedHex();return hextopem(w,"PUBLIC KEY")}if(D=="PKCS1PRV"&&n!==undefined&&b instanceof n&&(y===undefined||y==null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();return hextopem(w,"RSA PRIVATE KEY")}if(D=="PKCS1PRV"&&r!==undefined&&b instanceof r&&(y===undefined||y==null)&&b.isPrivate==true){var i=new z({name:b.curveName});var v=i.getEncodedHex();var h=B(b);var t=h.getEncodedHex();var p="";p+=hextopem(v,"EC PARAMETERS");p+=hextopem(t,"EC PRIVATE KEY");return p}if(D=="PKCS1PRV"&&u!==undefined&&b instanceof u&&(y===undefined||y==null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();return hextopem(w,"DSA PRIVATE KEY")}if(D=="PKCS5PRV"&&n!==undefined&&b instanceof n&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,y,m,j)}if(D=="PKCS5PRV"&&r!==undefined&&b instanceof r&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=B(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,y,m,j)}if(D=="PKCS5PRV"&&u!==undefined&&b instanceof u&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,y,m,j)}var o=function(G,s){var I=c(G,s);var H=new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:I.pbkdf2Salt}},{"int":I.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:I.encryptionSchemeIV}}]}]}]},{octstr:{hex:I.ciphertext}}]});return H.getEncodedHex()};var c=function(N,O){var H=100;var M=CryptoJS.lib.WordArray.random(8);var L="DES-EDE3-CBC";var s=CryptoJS.lib.WordArray.random(8);var I=CryptoJS.PBKDF2(O,M,{keySize:192/32,iterations:H});var J=CryptoJS.enc.Hex.parse(N);var K=CryptoJS.TripleDES.encrypt(J,I,{iv:s})+"";var G={};G.ciphertext=K;G.pbkdf2Salt=CryptoJS.enc.Hex.stringify(M);G.pbkdf2Iter=H;G.encryptionSchemeAlg=L;G.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s);return G};if(D=="PKCS8PRV"&&n!=undefined&&b instanceof n&&b.isPrivate==true){var g=A(b);var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"rsaEncryption"}},{"null":true}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&r!==undefined&&b instanceof r&&b.isPrivate==true){var g=new l({seq:[{"int":1},{octstr:{hex:b.prvKeyHex}},{tag:["a1",true,{bitstr:{hex:"00"+b.pubKeyHex}}]}]});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:b.curveName}}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&u!==undefined&&b instanceof u&&b.isPrivate==true){var g=new f({bigint:b.x});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"dsa"}},{seq:[{"int":{bigint:b.p}},{"int":{bigint:b.q}},{"int":{bigint:b.g}}]}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}throw new Error("unsupported object nor format")};KEYUTIL.getKeyFromCSRPEM=function(b){var a=pemtohex(b,"CERTIFICATE REQUEST");var c=KEYUTIL.getKeyFromCSRHex(a);return c};KEYUTIL.getKeyFromCSRHex=function(a){var c=KEYUTIL.parseCSRHex(a);var b=KEYUTIL.getKey(c.p8pubkeyhex,null,"pkcs8pub");return b};KEYUTIL.parseCSRHex=function(d){var i=ASN1HEX;var f=i.getChildIdx;var c=i.getTLV;var b={};var g=d;if(g.substr(0,2)!="30"){throw"malformed CSR(code:001)"}var e=f(g,0);if(e.length<1){throw"malformed CSR(code:002)"}if(g.substr(e[0],2)!="30"){throw"malformed CSR(code:003)"}var a=f(g,e[0]);if(a.length<3){throw"malformed CSR(code:004)"}b.p8pubkeyhex=c(g,a[2]);return b};KEYUTIL.getKeyID=function(f){var c=KEYUTIL;var e=ASN1HEX;if(typeof f==="string"&&f.indexOf("BEGIN ")!=-1){f=c.getKey(f)}var d=pemtohex(c.getPEM(f));var b=e.getIdxbyList(d,0,[1]);var a=e.getV(d,b).substring(2);return KJUR.crypto.Util.hashHex(a,"sha1")};KEYUTIL.getJWKFromKey=function(d){var b={};if(d instanceof RSAKey&&d.isPrivate){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));b.d=hextob64u(d.d.toString(16));b.p=hextob64u(d.p.toString(16));b.q=hextob64u(d.q.toString(16));b.dp=hextob64u(d.dmp1.toString(16));b.dq=hextob64u(d.dmq1.toString(16));b.qi=hextob64u(d.coeff.toString(16));return b}else{if(d instanceof RSAKey&&d.isPublic){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPrivate){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);b.d=hextob64u(d.prvKeyHex);return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPublic){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);return b}}}}throw"not supported key object"}; RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)};RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var n=ASN1HEX;var i=n.getV;var k=RSAKey.getPosArrayOfChildrenFromHex(f);var e=i(f,k[0]);var j=i(f,k[1]);var b=i(f,k[2]);var c=i(f,k[3]);var h=i(f,k[4]);var g=i(f,k[5]);var m=i(f,k[6]);var l=i(f,k[7]);var d=i(f,k[8]);var k=new Array();k.push(e,j,b,c,h,g,m,l,d);return k};RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d);var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,i,k,b,a,f,d,j;var m=ASN1HEX;var l=m.getVbyListEx;if(m.isASN1HEX(e)===false){throw new Error("not ASN.1 hex string")}try{c=l(e,0,[2,0,1],"02");i=l(e,0,[2,0,2],"02");k=l(e,0,[2,0,3],"02");b=l(e,0,[2,0,4],"02");a=l(e,0,[2,0,5],"02");f=l(e,0,[2,0,6],"02");d=l(e,0,[2,0,7],"02");j=l(e,0,[2,0,8],"02")}catch(g){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(c,i,k,b,a,f,d,j)};RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX;var b=e.getV;if(e.isASN1HEX(c)===false){throw new Error("keyHex is not ASN.1 hex string")}var a=e.getChildIdx(c,0);if(a.length!==2||c.substr(a[0],2)!=="02"||c.substr(a[1],2)!=="02"){throw new Error("wrong hex for PKCS#5 public key")}var f=b(c,a[0]);var d=b(c,a[1]);this.setPublic(f,d)};RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(c.isASN1HEX(b)===false){throw new Error("not ASN.1 hex string")}if(c.getTLVbyListEx(b,0,[0,0])!=="06092a864886f70d010101"){throw new Error("not PKCS8 RSA public key")}var a=c.getTLVbyListEx(b,0,[1,0]);this.readPKCS5PubKeyHex(a)};RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;a=new X509();a.readCertHex(b);c=a.getPublicKeyHex();this.readPKCS8PubKeyHex(c)}; var _RE_HEXDECONLY=new RegExp("[^0-9a-f]","gi");function _rsasign_getHexPaddedDigestInfoForString(d,e,a){var b=function(f){return KJUR.crypto.Util.hashString(f,a)};var c=b(d);return KJUR.crypto.Util.getPaddedDigestInfoHex(c,a,e)}function _zeroPaddingOfSignature(e,d){var c="";var a=d/4-e.length;for(var b=0;b>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;dthis.n.bitLength()){return 0}var i=this.doPublic(b);var e=i.toString(16).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(k){return KJUR.crypto.Util.hashString(k,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;q0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w1){var z=b(v,u[1]);var t=this.getGeneraName(z);if(t.uri!=undefined){s.uri=t.uri}}if(u.length>2){var w=b(v,u[2]);if(w=="0101ff"){s.reqauth=true}if(w=="010100"){s.reqauth=false}}return s};this.getX500NameRule=function(s){var z=true;var D=true;var C=false;var t="";var w="";var F=null;var A=[];for(var v=0;v0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w0){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;var k=e.split(".");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.gracePeriodl){this.aHeader.pop()}if(this.aSignature.length>l){this.aSignature.pop()}throw"addSignature failed: "+i}};this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length){return false}for(var g=0;g0){this.aHeader=g.headers}else{throw"malformed header"}if(typeof g.payload==="string"){this.sPayload=g.payload}else{throw"malformed signatures"}if(g.signatures.length>0){this.aSignature=g.signatures}else{throw"malformed signatures"}}catch(e){throw"malformed JWS-JS JSON object: "+e}}};this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}};this.isEmpty=function(){if(this.aHeader.length==0){return 1}return 0}}; diff --git a/npm/lib/jsrsasign-jwths-min.js b/npm/lib/jsrsasign-jwths-min.js index 76a73e71..240cbb65 100644 --- a/npm/lib/jsrsasign-jwths-min.js +++ b/npm/lib/jsrsasign-jwths-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(jwths) 10.0.0 (2020-09-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(jwths) 10.0.1 (2020-10-14) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! diff --git a/npm/lib/jsrsasign-rsa-min.js b/npm/lib/jsrsasign-rsa-min.js index 36c50307..b330ecc7 100644 --- a/npm/lib/jsrsasign-rsa-min.js +++ b/npm/lib/jsrsasign-rsa-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(rsa) 10.0.0 (2020-09-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(rsa) 10.0.1 (2020-10-14) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! @@ -98,7 +98,7 @@ function parseBigInt(b,a){return new BigInteger(b,a)}function linebrk(c,d){var a /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f=a.length){return null}}var e="";while(++f191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}function oaep_mgf1_str(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255]));d+=1}return b}function oaep_unpad(o,b,g,p){var e=KJUR.crypto.MessageDigest;var r=KJUR.crypto.Util;var c=null;if(!g){g="sha1"}if(typeof g==="string"){c=e.getCanonicalAlgName(g);p=e.getHashLength(c);g=function(d){return hextorstr(r.hashHex(rstrtohex(d),c))}}o=o.toByteArray();var h;for(h=0;h0&&a.length>0){this.n=parseBigInt(c,16);this.e=parseInt(a,16);this.d=parseBigInt(b,16)}else{throw"Invalid RSA private key"}}}function RSASetPrivateEx(g,d,e,c,b,a,h,f){this.isPrivate=true;this.isPublic=false;if(g==null){throw"RSASetPrivateEx N == null"}if(d==null){throw"RSASetPrivateEx E == null"}if(g.length==0){throw"RSASetPrivateEx N.length == 0"}if(d.length==0){throw"RSASetPrivateEx E.length == 0"}if(g!=null&&d!=null&&g.length>0&&d.length>0){this.n=parseBigInt(g,16);this.e=parseInt(d,16);this.d=parseBigInt(e,16);this.p=parseBigInt(c,16);this.q=parseBigInt(b,16);this.dmp1=parseBigInt(a,16);this.dmq1=parseBigInt(h,16);this.coeff=parseBigInt(f,16)}else{throw"Invalid RSA private key in RSASetPrivateEx"}}function RSAGenerate(b,i){var a=new SecureRandom();var f=b>>1;this.e=parseInt(i,16);var c=new BigInteger(i,16);for(;;){for(;;){this.p=new BigInteger(b-f,1,a);if(this.p.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new BigInteger(f,1,a);if(this.q.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var h=this.p;this.p=this.q;this.q=h}var g=this.p.subtract(BigInteger.ONE);var d=this.q.subtract(BigInteger.ONE);var e=g.multiply(d);if(e.gcd(c).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);if(this.n.bitLength()==b){this.d=c.modInverse(e);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(d);this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=true}function RSADoPrivate(a){if(this.p==null||this.q==null){return a.modPow(this.d,this.n)}var c=a.mod(this.p).modPow(this.dmp1,this.p);var b=a.mod(this.q).modPow(this.dmq1,this.q);while(c.compareTo(b)<0){c=c.add(this.p)}return c.subtract(b).multiply(this.coeff).mod(this.p).multiply(this.q).add(b)}function RSADecrypt(b){if(b.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var d=parseBigInt(b,16);var a=this.doPrivate(d);if(a==null){return null}return pkcs1unpad2(a,(this.n.bitLength()+7)>>3)}function RSADecryptOAEP(e,d,b){if(e.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var f=parseBigInt(e,16);var a=this.doPrivate(f);if(a==null){return null}return oaep_unpad(a,(this.n.bitLength()+7)>>3,d,b)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate;RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;RSAKey.prototype.decryptOAEP=RSADecryptOAEP; -if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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.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.getEncodedHex()}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 '"+hextoutf8(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;u31){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;ef.length){f=c[d]}}e=e.replace(f,"::");return e.slice(1,-1)}function hextoip(b){var d="malformed hex value";if(!b.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){throw d}if(b.length==8){var c;try{c=parseInt(b.substr(0,2),16)+"."+parseInt(b.substr(2,2),16)+"."+parseInt(b.substr(4,2),16)+"."+parseInt(b.substr(6,2),16);return c}catch(a){throw d}}else{if(b.length==32){return hextoipv6(b)}else{return b}}}function iptohex(f){var j="malformed IP address";f=f.toLowerCase(f);if(f.match(/^[0-9.]+$/)){var b=f.split(".");if(b.length!==4){throw j}var g="";try{for(var e=0;e<4;e++){var h=parseInt(b[e]);g+=("0"+h.toString(16)).slice(-2)}return g}catch(c){throw j}}else{if(f.match(/^[0-9a-f:]+$/)&&f.indexOf(":")!==-1){return ipv6tohex(f)}else{throw j}}}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;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;f=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); -if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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||715){throw"ASN.1 length too long to represent by 8x: n = "+j.toString(16)}var g=128+h;return g.toString(16)+i}};this.getEncodedHex=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.getValueHex=function(){this.getEncodedHex();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)}}}}};YAHOO.lang.extend(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.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(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}};YAHOO.lang.extend(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}}};YAHOO.lang.extend(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"}};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(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.getEncodedHex()}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.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.getEncodedHex()}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 '"+hextoutf8(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;u31){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;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){n.push(new c({tag:"a3",obj:new j(q.ext)}))}var o=new KJUR.asn1.DERSequence({array:n});return o.getEncodedHex()};if(f!==undefined){this.setByParam(f)}};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extensions=function(d){KJUR.asn1.x509.Extensions.superclass.constructor.call(this);var c=KJUR,b=c.asn1,a=b.DERSequence,e=b.x509;this.aParam=[];this.setByParam=function(f){this.aParam=f};this.getEncodedHex=function(){var f=[];for(var h=0;h-1){i.push(new f({"int":this.pathLen}))}var h=new b({array:i});this.asn1ExtnValue=h;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(g!==undefined){if(g.cA!==undefined){this.cA=g.cA}if(g.pathLen!==undefined){this.pathLen=g.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){var f=[];for(var g=0;g0){f.push(new b({array:j}))}}var g=new b({array:f});return g.getEncodedHex()};if(d!==undefined){this.params=d}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation,KJUR.asn1.ASN1Object);KJUR.asn1.x509.PolicyQualifierInfo=function(e){KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var c=KJUR.asn1,b=c.DERSequence,d=c.DERIA5String,f=c.DERObjectIdentifier,a=c.x509.UserNotice;this.params=null;this.getEncodedHex=function(){if(this.params.cps!==undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.1"}),new d({str:this.params.cps})]});return g.getEncodedHex()}if(this.params.unotice!=undefined){var g=new b({array:[new f({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return g.getEncodedHex()}};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.UserNotice=function(e){KJUR.asn1.x509.UserNotice.superclass.constructor.call(this,e);var a=KJUR.asn1.DERSequence,d=KJUR.asn1.DERInteger,c=KJUR.asn1.x509.DisplayText,b=KJUR.asn1.x509.NoticeReference;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.noticeref!==undefined){f.push(new b(this.params.noticeref))}if(this.params.exptext!==undefined){f.push(new c(this.params.exptext))}var g=new a({array:f});return g.getEncodedHex()};if(e!==undefined){this.params=e}};YAHOO.lang.extend(KJUR.asn1.x509.UserNotice,KJUR.asn1.ASN1Object);KJUR.asn1.x509.NoticeReference=function(d){KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this,d);var a=KJUR.asn1.DERSequence,c=KJUR.asn1.DERInteger,b=KJUR.asn1.x509.DisplayText;this.params=null;this.getEncodedHex=function(){var f=[];if(this.params.org!==undefined){f.push(new b(this.params.org))}if(this.params.noticenum!==undefined){var h=[];var e=this.params.noticenum;for(var j=0;j0){for(var g=0;g0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(b){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=[];this.paramArray=[];this.sRule="utf8";var a=KJUR.asn1.x509.AttributeTypeAndValue;this.setByParam=function(c){if(c.rule!==undefined){this.sRule=c.rule}if(c.str!==undefined){this.addByMultiValuedString(c.str)}if(c.array!==undefined){this.paramArray=c.array}};this.addByString=function(c){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:c,rule:this.sRule}))};this.addByMultiValuedString=function(e){var c=KJUR.asn1.x509.RDN.parseString(e);for(var d=0;d0){for(var d=0;d0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(c){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);this.sRule="utf8";this.sType=null;this.sValue=null;this.dsType=null;var a=KJUR,g=a.asn1,d=g.DERSequence,l=g.DERUTF8String,i=g.DERPrintableString,h=g.DERTeletexString,b=g.DERIA5String,e=g.DERVisibleString,k=g.DERBMPString,f=a.lang.String.isMail,j=a.lang.String.isPrintable;this.setByParam=function(o){if(o.rule!==undefined){this.sRule=o.rule}if(o.ds!==undefined){this.dsType=o.ds}if(o.value===undefined&&o.str!==undefined){var n=o.str;var m=n.match(/^([^=]+)=(.+)$/);if(m){this.sType=m[1];this.sValue=m[2]}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}}else{this.sType=o.type;this.sValue=o.value}};this.setByString=function(n,o){if(o!==undefined){this.sRule=o}var m=n.match(/^([^=]+)=(.+)$/);if(m){this.setByAttrTypeAndValueStr(m[1],m[2])}else{throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}};this._getDsType=function(){var o=this.sType;var n=this.sValue;var m=this.sRule;if(m==="prn"){if(o=="CN"&&f(n)){return"ia5"}if(j(n)){return"prn"}return"utf8"}else{if(m==="utf8"){if(o=="CN"&&f(n)){return"ia5"}if(o=="C"){return"prn"}return"utf8"}}return"utf8"};this.setByAttrTypeAndValueStr=function(o,n,m){if(m!==undefined){this.sRule=m}this.sType=o;this.sValue=n};this.getValueObj=function(n,m){if(n=="utf8"){return new l({str:m})}if(n=="prn"){return new i({str:m})}if(n=="tel"){return new h({str:m})}if(n=="ia5"){return new b({str:m})}if(n=="vis"){return new e({str:m})}if(n=="bmp"){return new k({str:m})}throw new Error("unsupported directory string type: type="+n+" value="+m)};this.getEncodedHex=function(){if(this.dsType==null){this.dsType=this._getDsType()}var n=KJUR.asn1.x509.OID.atype2obj(this.sType);var m=this.getValueObj(this.dsType,this.sValue);var p=new d({array:[n,m]});this.TLV=p.getEncodedHex();return this.TLV};if(c!==undefined){this.setByParam(c)}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(e){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1,c=a.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw new Error("algorithm not specified")}if(this.nameAlg!==null){var f=null;for(var h in c){if(h===this.nameAlg){f=c[h]}}if(f!==null){this.hTLV=f;return this.hTLV}}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var g=[this.asn1Alg];if(this.asn1Params!==null){g.push(this.asn1Params)}var i=new a.DERSequence({array:g});this.hTLV=i.getEncodedHex();return this.hTLV};if(e!==undefined){if(e.name!==undefined){this.nameAlg=e.name}if(e.asn1params!==undefined){this.asn1Params=e.asn1params}if(e.paramempty!==undefined){this.paramEmpty=e.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){if(this.nameAlg.name!==undefined){this.nameAlg=this.nameAlg.name}var d=this.nameAlg.toLowerCase();if(d.substr(-7,7)!=="withdsa"&&d.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e=u*2){break}}var z={};z.keyhex=x.substr(0,i[q]["keylen"]*2);z.ivhex=x.substr(i[q]["keylen"]*2,i[q]["ivlen"]*2);return z};var b=function(p,v,r,w){var s=CryptoJS.enc.Base64.parse(p);var q=CryptoJS.enc.Hex.stringify(s);var u=i[v]["proc"];var t=u(q,r,w);return t};var h=function(p,s,q,u){var r=i[s]["eproc"];var t=r(p,q,u);return t};return{version:"1.0.0",parsePKCS5PEM:function(p){return n(p)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(q,p,r){return j(q,p,r)},decryptKeyB64:function(p,r,q,s){return b(p,r,q,s)},getDecryptedKeyHex:function(y,x){var q=n(y);var t=q.type;var r=q.cipher;var p=q.ivsalt;var s=q.data;var w=j(r,x,p);var v=w.keyhex;var u=b(s,r,v,p);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(x,s,A,t,r){var p="";if(typeof t=="undefined"||t==null){t="AES-256-CBC"}if(typeof i[t]=="undefined"){throw"KEYUTIL unsupported algorithm: "+t}if(typeof r=="undefined"||r==null){var v=i[t]["ivlen"];var u=m(v);r=u.toUpperCase()}var z=j(t,A,r);var y=z.keyhex;var w=h(s,t,y,r);var q=w.replace(/(.{64})/g,"$1\r\n");var p="-----BEGIN "+x+" PRIVATE KEY-----\r\n";p+="Proc-Type: 4,ENCRYPTED\r\n";p+="DEK-Info: "+t+","+r+"\r\n";p+="\r\n";p+=q;p+="\r\n-----END "+x+" PRIVATE KEY-----\r\n";return p},parseHexOfEncryptedPKCS8:function(y){var B=ASN1HEX;var z=B.getChildIdx;var w=B.getV;var t={};var r=z(y,0);if(r.length!=2){throw"malformed format: SEQUENCE(0).items != 2: "+r.length}t.ciphertext=w(y,r[1]);var A=z(y,r[0]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0).items != 2: "+A.length}if(w(y,A[0])!="2a864886f70d01050d"){throw"this only supports pkcs5PBES2"}var p=z(y,A[1]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0.1).items != 2: "+p.length}var q=z(y,p[1]);if(q.length!=2){throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+q.length}if(w(y,q[0])!="2a864886f70d0307"){throw"this only supports TripleDES"}t.encryptionSchemeAlg="TripleDES";t.encryptionSchemeIV=w(y,q[1]);var s=z(y,p[0]);if(s.length!=2){throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+s.length}if(w(y,s[0])!="2a864886f70d01050c"){throw"this only supports pkcs5PBKDF2"}var x=z(y,s[1]);if(x.length<2){throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+x.length}t.pbkdf2Salt=w(y,x[0]);var u=w(y,x[1]);try{t.pbkdf2Iter=parseInt(u,16)}catch(v){throw"malformed format pbkdf2Iter: "+u}return t},getPBKDF2KeyHexFromParam:function(u,p){var t=CryptoJS.enc.Hex.parse(u.pbkdf2Salt);var q=u.pbkdf2Iter;var s=CryptoJS.PBKDF2(p,t,{keySize:192/32,iterations:q});var r=CryptoJS.enc.Hex.stringify(s);return r},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(x,y){var r=pemtohex(x,"ENCRYPTED PRIVATE KEY");var p=this.parseHexOfEncryptedPKCS8(r);var u=KEYUTIL.getPBKDF2KeyHexFromParam(p,y);var v={};v.ciphertext=CryptoJS.enc.Hex.parse(p.ciphertext);var t=CryptoJS.enc.Hex.parse(u);var s=CryptoJS.enc.Hex.parse(p.encryptionSchemeIV);var w=CryptoJS.TripleDES.decrypt(v,t,{iv:s});var q=CryptoJS.enc.Hex.stringify(w);return q},getKeyFromEncryptedPKCS8PEM:function(s,q){var p=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s,q);var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},parsePlainPrivatePKCS8Hex:function(s){var v=ASN1HEX;var u=v.getChildIdx;var t=v.getV;var q={};q.algparam=null;if(s.substr(0,2)!="30"){throw"malformed plain PKCS8 private key(code:001)"}var r=u(s,0);if(r.length!=3){throw"malformed plain PKCS8 private key(code:002)"}if(s.substr(r[1],2)!="30"){throw"malformed PKCS8 private key(code:003)"}var p=u(s,r[1]);if(p.length!=2){throw"malformed PKCS8 private key(code:004)"}if(s.substr(p[0],2)!="06"){throw"malformed PKCS8 private key(code:005)"}q.algoid=t(s,p[0]);if(s.substr(p[1],2)=="06"){q.algparam=t(s,p[1])}if(s.substr(r[2],2)!="04"){throw"malformed PKCS8 private key(code:006)"}q.keyidx=v.getVidx(s,r[2]);return q},getKeyFromPlainPrivatePKCS8PEM:function(q){var p=pemtohex(q,"PRIVATE KEY");var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},getKeyFromPlainPrivatePKCS8Hex:function(p){var q=this.parsePlainPrivatePKCS8Hex(p);var r;if(q.algoid=="2a864886f70d010101"){r=new RSAKey()}else{if(q.algoid=="2a8648ce380401"){r=new KJUR.crypto.DSA()}else{if(q.algoid=="2a8648ce3d0201"){r=new KJUR.crypto.ECDSA()}else{throw"unsupported private key algorithm"}}}r.readPKCS8PrvKeyHex(p);return r},_getKeyFromPublicPKCS8Hex:function(q){var p;var r=ASN1HEX.getVbyList(q,0,[0,0],"06");if(r==="2a864886f70d010101"){p=new RSAKey()}else{if(r==="2a8648ce380401"){p=new KJUR.crypto.DSA()}else{if(r==="2a8648ce3d0201"){p=new KJUR.crypto.ECDSA()}else{throw"unsupported PKCS#8 public key hex"}}}p.readPKCS8PubKeyHex(q);return p},parsePublicRawRSAKeyHex:function(r){var u=ASN1HEX;var t=u.getChildIdx;var s=u.getV;var p={};if(r.substr(0,2)!="30"){throw"malformed RSA key(code:001)"}var q=t(r,0);if(q.length!=2){throw"malformed RSA key(code:002)"}if(r.substr(q[0],2)!="02"){throw"malformed RSA key(code:003)"}p.n=s(r,q[0]);if(r.substr(q[1],2)!="02"){throw"malformed RSA key(code:004)"}p.e=s(r,q[1]);return p},parsePublicPKCS8Hex:function(t){var v=ASN1HEX;var u=v.getChildIdx;var s=v.getV;var q={};q.algparam=null;var r=u(t,0);if(r.length!=2){throw"outer DERSequence shall have 2 elements: "+r.length}var w=r[0];if(t.substr(w,2)!="30"){throw"malformed PKCS8 public key(code:001)"}var p=u(t,w);if(p.length!=2){throw"malformed PKCS8 public key(code:002)"}if(t.substr(p[0],2)!="06"){throw"malformed PKCS8 public key(code:003)"}q.algoid=s(t,p[0]);if(t.substr(p[1],2)=="06"){q.algparam=s(t,p[1])}else{if(t.substr(p[1],2)=="30"){q.algparam={};q.algparam.p=v.getVbyList(t,p[1],[0],"02");q.algparam.q=v.getVbyList(t,p[1],[1],"02");q.algparam.g=v.getVbyList(t,p[1],[2],"02")}}if(t.substr(r[1],2)!="03"){throw"malformed PKCS8 public key(code:004)"}q.key=s(t,r[1]).substr(2);return q},}}();KEYUTIL.getKey=function(l,k,n){var G=ASN1HEX,L=G.getChildIdx,v=G.getV,d=G.getVbyList,c=KJUR.crypto,i=c.ECDSA,C=c.DSA,w=RSAKey,M=pemtohex,F=KEYUTIL;if(typeof w!="undefined"&&l instanceof w){return l}if(typeof i!="undefined"&&l instanceof i){return l}if(typeof C!="undefined"&&l instanceof C){return l}if(l.curve!==undefined&&l.xy!==undefined&&l.d===undefined){return new i({pub:l.xy,curve:l.curve})}if(l.curve!==undefined&&l.d!==undefined){return new i({prv:l.d,curve:l.curve})}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(l.n,l.e);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.co!==undefined&&l.qi===undefined){var P=new w();P.setPrivateEx(l.n,l.e,l.d,l.p,l.q,l.dp,l.dq,l.co);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p===undefined){var P=new w();P.setPrivate(l.n,l.e,l.d);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x===undefined){var P=new C();P.setPublic(l.p,l.q,l.g,l.y);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x!==undefined){var P=new C();P.setPrivate(l.p,l.q,l.g,l.y,l.x);return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(b64utohex(l.n),b64utohex(l.e));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.qi!==undefined){var P=new w();P.setPrivateEx(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d),b64utohex(l.p),b64utohex(l.q),b64utohex(l.dp),b64utohex(l.dq),b64utohex(l.qi));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined){var P=new w();P.setPrivate(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d));return P}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d===undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;j.setPublicKeyHex(u);return j}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d!==undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;var b=("0000000000"+b64utohex(l.d)).slice(-t);j.setPublicKeyHex(u);j.setPrivateKeyHex(b);return j}if(n==="pkcs5prv"){var J=l,G=ASN1HEX,N,P;N=L(J,0);if(N.length===9){P=new w();P.readPKCS5PrvKeyHex(J)}else{if(N.length===6){P=new C();P.readPKCS5PrvKeyHex(J)}else{if(N.length>2&&J.substr(N[1],2)==="04"){P=new i();P.readPKCS5PrvKeyHex(J)}else{throw"unsupported PKCS#1/5 hexadecimal key"}}}return P}if(n==="pkcs8prv"){var P=F.getKeyFromPlainPrivatePKCS8Hex(l);return P}if(n==="pkcs8pub"){return F._getKeyFromPublicPKCS8Hex(l)}if(n==="x509pub"){return X509.getPublicKeyFromCertHex(l)}if(l.indexOf("-END CERTIFICATE-",0)!=-1||l.indexOf("-END X509 CERTIFICATE-",0)!=-1||l.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1){return X509.getPublicKeyFromCertPEM(l)}if(l.indexOf("-END PUBLIC KEY-")!=-1){var O=pemtohex(l,"PUBLIC KEY");return F._getKeyFromPublicPKCS8Hex(O)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"RSA PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var I=M(l,"DSA PRIVATE KEY");var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"EC PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END PRIVATE KEY-")!=-1){return F.getKeyFromPlainPrivatePKCS8PEM(l)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var o=F.getDecryptedKeyHex(l,k);var H=new RSAKey();H.readPKCS5PrvKeyHex(o);return H}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var P=d(I,0,[1],"04");var f=d(I,0,[2,0],"06");var A=d(I,0,[3,0],"03").substr(2);var e="";if(KJUR.crypto.OID.oidhex2name[f]!==undefined){e=KJUR.crypto.OID.oidhex2name[f]}else{throw"undefined OID(hex) in KJUR.crypto.OID: "+f}var j=new i({curve:e});j.setPublicKeyHex(A);j.setPrivateKeyHex(P);j.isPublic=false;return j}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1){return F.getKeyFromEncryptedPKCS8PEM(l,k)}throw new Error("not supported argument")};KEYUTIL.generateKeypair=function(a,c){if(a=="RSA"){var b=c;var h=new RSAKey();h.generate(b,"10001");h.isPrivate=true;h.isPublic=true;var f=new RSAKey();var e=h.n.toString(16);var i=h.e.toString(16);f.setPublic(e,i);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{if(a=="EC"){var d=c;var g=new KJUR.crypto.ECDSA({curve:d});var j=g.generateKeyPairHex();var h=new KJUR.crypto.ECDSA({curve:d});h.setPublicKeyHex(j.ecpubhex);h.setPrivateKeyHex(j.ecprvhex);h.isPrivate=true;h.isPublic=false;var f=new KJUR.crypto.ECDSA({curve:d});f.setPublicKeyHex(j.ecpubhex);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{throw"unknown algorithm: "+a}}};KEYUTIL.getPEM=function(b,D,y,m,q,j){var F=KJUR,k=F.asn1,z=k.DERObjectIdentifier,f=k.DERInteger,l=k.ASN1Util.newObject,a=k.x509,C=a.SubjectPublicKeyInfo,e=F.crypto,u=e.DSA,r=e.ECDSA,n=RSAKey;function A(s){var G=l({seq:[{"int":0},{"int":{bigint:s.n}},{"int":s.e},{"int":{bigint:s.d}},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.dmp1}},{"int":{bigint:s.dmq1}},{"int":{bigint:s.coeff}}]});return G}function B(G){var s=l({seq:[{"int":1},{octstr:{hex:G.prvKeyHex}},{tag:["a0",true,{oid:{name:G.curveName}}]},{tag:["a1",true,{bitstr:{hex:"00"+G.pubKeyHex}}]}]});return s}function x(s){var G=l({seq:[{"int":0},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.g}},{"int":{bigint:s.y}},{"int":{bigint:s.x}}]});return G}if(((n!==undefined&&b instanceof n)||(u!==undefined&&b instanceof u)||(r!==undefined&&b instanceof r))&&b.isPublic==true&&(D===undefined||D=="PKCS8PUB")){var E=new C(b);var w=E.getEncodedHex();return hextopem(w,"PUBLIC KEY")}if(D=="PKCS1PRV"&&n!==undefined&&b instanceof n&&(y===undefined||y==null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();return hextopem(w,"RSA PRIVATE KEY")}if(D=="PKCS1PRV"&&r!==undefined&&b instanceof r&&(y===undefined||y==null)&&b.isPrivate==true){var i=new z({name:b.curveName});var v=i.getEncodedHex();var h=B(b);var t=h.getEncodedHex();var p="";p+=hextopem(v,"EC PARAMETERS");p+=hextopem(t,"EC PRIVATE KEY");return p}if(D=="PKCS1PRV"&&u!==undefined&&b instanceof u&&(y===undefined||y==null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();return hextopem(w,"DSA PRIVATE KEY")}if(D=="PKCS5PRV"&&n!==undefined&&b instanceof n&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,y,m,j)}if(D=="PKCS5PRV"&&r!==undefined&&b instanceof r&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=B(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,y,m,j)}if(D=="PKCS5PRV"&&u!==undefined&&b instanceof u&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,y,m,j)}var o=function(G,s){var I=c(G,s);var H=new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:I.pbkdf2Salt}},{"int":I.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:I.encryptionSchemeIV}}]}]}]},{octstr:{hex:I.ciphertext}}]});return H.getEncodedHex()};var c=function(N,O){var H=100;var M=CryptoJS.lib.WordArray.random(8);var L="DES-EDE3-CBC";var s=CryptoJS.lib.WordArray.random(8);var I=CryptoJS.PBKDF2(O,M,{keySize:192/32,iterations:H});var J=CryptoJS.enc.Hex.parse(N);var K=CryptoJS.TripleDES.encrypt(J,I,{iv:s})+"";var G={};G.ciphertext=K;G.pbkdf2Salt=CryptoJS.enc.Hex.stringify(M);G.pbkdf2Iter=H;G.encryptionSchemeAlg=L;G.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s);return G};if(D=="PKCS8PRV"&&n!=undefined&&b instanceof n&&b.isPrivate==true){var g=A(b);var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"rsaEncryption"}},{"null":true}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&r!==undefined&&b instanceof r&&b.isPrivate==true){var g=new l({seq:[{"int":1},{octstr:{hex:b.prvKeyHex}},{tag:["a1",true,{bitstr:{hex:"00"+b.pubKeyHex}}]}]});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:b.curveName}}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&u!==undefined&&b instanceof u&&b.isPrivate==true){var g=new f({bigint:b.x});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"dsa"}},{seq:[{"int":{bigint:b.p}},{"int":{bigint:b.q}},{"int":{bigint:b.g}}]}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}throw new Error("unsupported object nor format")};KEYUTIL.getKeyFromCSRPEM=function(b){var a=pemtohex(b,"CERTIFICATE REQUEST");var c=KEYUTIL.getKeyFromCSRHex(a);return c};KEYUTIL.getKeyFromCSRHex=function(a){var c=KEYUTIL.parseCSRHex(a);var b=KEYUTIL.getKey(c.p8pubkeyhex,null,"pkcs8pub");return b};KEYUTIL.parseCSRHex=function(d){var i=ASN1HEX;var f=i.getChildIdx;var c=i.getTLV;var b={};var g=d;if(g.substr(0,2)!="30"){throw"malformed CSR(code:001)"}var e=f(g,0);if(e.length<1){throw"malformed CSR(code:002)"}if(g.substr(e[0],2)!="30"){throw"malformed CSR(code:003)"}var a=f(g,e[0]);if(a.length<3){throw"malformed CSR(code:004)"}b.p8pubkeyhex=c(g,a[2]);return b};KEYUTIL.getKeyID=function(f){var c=KEYUTIL;var e=ASN1HEX;if(typeof f==="string"&&f.indexOf("BEGIN ")!=-1){f=c.getKey(f)}var d=pemtohex(c.getPEM(f));var b=e.getIdxbyList(d,0,[1]);var a=e.getV(d,b).substring(2);return KJUR.crypto.Util.hashHex(a,"sha1")};KEYUTIL.getJWKFromKey=function(d){var b={};if(d instanceof RSAKey&&d.isPrivate){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));b.d=hextob64u(d.d.toString(16));b.p=hextob64u(d.p.toString(16));b.q=hextob64u(d.q.toString(16));b.dp=hextob64u(d.dmp1.toString(16));b.dq=hextob64u(d.dmq1.toString(16));b.qi=hextob64u(d.coeff.toString(16));return b}else{if(d instanceof RSAKey&&d.isPublic){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPrivate){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);b.d=hextob64u(d.prvKeyHex);return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPublic){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);return b}}}}throw"not supported key object"}; RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)};RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var n=ASN1HEX;var i=n.getV;var k=RSAKey.getPosArrayOfChildrenFromHex(f);var e=i(f,k[0]);var j=i(f,k[1]);var b=i(f,k[2]);var c=i(f,k[3]);var h=i(f,k[4]);var g=i(f,k[5]);var m=i(f,k[6]);var l=i(f,k[7]);var d=i(f,k[8]);var k=new Array();k.push(e,j,b,c,h,g,m,l,d);return k};RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d);var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,i,k,b,a,f,d,j;var m=ASN1HEX;var l=m.getVbyListEx;if(m.isASN1HEX(e)===false){throw new Error("not ASN.1 hex string")}try{c=l(e,0,[2,0,1],"02");i=l(e,0,[2,0,2],"02");k=l(e,0,[2,0,3],"02");b=l(e,0,[2,0,4],"02");a=l(e,0,[2,0,5],"02");f=l(e,0,[2,0,6],"02");d=l(e,0,[2,0,7],"02");j=l(e,0,[2,0,8],"02")}catch(g){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(c,i,k,b,a,f,d,j)};RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX;var b=e.getV;if(e.isASN1HEX(c)===false){throw new Error("keyHex is not ASN.1 hex string")}var a=e.getChildIdx(c,0);if(a.length!==2||c.substr(a[0],2)!=="02"||c.substr(a[1],2)!=="02"){throw new Error("wrong hex for PKCS#5 public key")}var f=b(c,a[0]);var d=b(c,a[1]);this.setPublic(f,d)};RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(c.isASN1HEX(b)===false){throw new Error("not ASN.1 hex string")}if(c.getTLVbyListEx(b,0,[0,0])!=="06092a864886f70d010101"){throw new Error("not PKCS8 RSA public key")}var a=c.getTLVbyListEx(b,0,[1,0]);this.readPKCS5PubKeyHex(a)};RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;a=new X509();a.readCertHex(b);c=a.getPublicKeyHex();this.readPKCS8PubKeyHex(c)}; var _RE_HEXDECONLY=new RegExp("[^0-9a-f]","gi");function _rsasign_getHexPaddedDigestInfoForString(d,e,a){var b=function(f){return KJUR.crypto.Util.hashString(f,a)};var c=b(d);return KJUR.crypto.Util.getPaddedDigestInfoHex(c,a,e)}function _zeroPaddingOfSignature(e,d){var c="";var a=d/4-e.length;for(var b=0;b>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;dthis.n.bitLength()){return 0}var i=this.doPublic(b);var e=i.toString(16).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(k){return KJUR.crypto.Util.hashString(k,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;q0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w1){var z=b(v,u[1]);var t=this.getGeneraName(z);if(t.uri!=undefined){s.uri=t.uri}}if(u.length>2){var w=b(v,u[2]);if(w=="0101ff"){s.reqauth=true}if(w=="010100"){s.reqauth=false}}return s};this.getX500NameRule=function(s){var z=true;var D=true;var C=false;var t="";var w="";var F=null;var A=[];for(var v=0;v0){s.ext=this.getExtParamArray()}s.sighex=this.getSignatureValueHex();return s};this.getExtParamArray=function(t){if(t==undefined){var v=e(this.hex,0,[0,"[3]"]);if(v!=-1){t=l(this.hex,0,[0,"[3]",0],"30")}}var s=[];var u=n(t,0);for(var w=0;w0){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;var k=e.split(".");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.gracePeriodl){this.aHeader.pop()}if(this.aSignature.length>l){this.aSignature.pop()}throw"addSignature failed: "+i}};this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length){return false}for(var g=0;g0){this.aHeader=g.headers}else{throw"malformed header"}if(typeof g.payload==="string"){this.sPayload=g.payload}else{throw"malformed signatures"}if(g.signatures.length>0){this.aSignature=g.signatures}else{throw"malformed signatures"}}catch(e){throw"malformed JWS-JS JSON object: "+e}}};this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}};this.isEmpty=function(){if(this.aHeader.length==0){return 1}return 0}}; diff --git a/npm/package.json b/npm/package.json index dba7d637..3889adfb 100755 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "jsrsasign", - "version": "10.0.0", + "version": "10.0.1", "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/src/asn1-1.0.js b/src/asn1-1.0.js index 3798b1ae..b46a47f2 100644 --- a/src/asn1-1.0.js +++ b/src/asn1-1.0.js @@ -1,4 +1,4 @@ -/* asn1-1.0.19.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license +/* asn1-1.0.20.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /* * asn1.js - ASN.1 DER encoder classes @@ -16,7 +16,7 @@ * @fileOverview * @name asn1-1.0.js * @author Kenji Urushima kenji.urushima@gmail.com - * @version jsrsasign 10.0.0 asn1 1.0.19 (2020-Sep-22) + * @version jsrsasign 10.0.1 asn1 1.0.20 (2020-Oct-11) * @since jsrsasign 2.1 * @license MIT License */ @@ -790,13 +790,21 @@ YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object); * @name KJUR.asn1.DERBoolean * @class class for ASN.1 DER Boolean * @extends KJUR.asn1.ASN1Object - * @description * @see KJUR.asn1.ASN1Object - superclass + * @description + * In ASN.1 DER, DER Boolean "false" shall be omitted. + * However this supports boolean false for future BER support. + * @example + * new KJUR.asn1.DERBoolean(true) + * new KJUR.asn1.DERBoolean(false) */ -KJUR.asn1.DERBoolean = function() { +KJUR.asn1.DERBoolean = function(params) { KJUR.asn1.DERBoolean.superclass.constructor.call(this); this.hT = "01"; - this.hTLV = "0101ff"; + if (params == false) + this.hTLV = "010100"; + else + this.hTLV = "0101ff"; }; YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object); diff --git a/src/asn1x509-1.0.js b/src/asn1x509-1.0.js index 4d62a481..e58386f4 100644 --- a/src/asn1x509-1.0.js +++ b/src/asn1x509-1.0.js @@ -1,4 +1,4 @@ -/* asn1x509-2.1.3.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license +/* asn1x509-2.1.4.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /* * asn1x509.js - ASN.1 DER encoder classes for X.509 certificate @@ -16,7 +16,7 @@ * @fileOverview * @name asn1x509-1.0.js * @author Kenji Urushima kenji.urushima@gmail.com - * @version jsrsasign 10.0.0 asn1x509 2.1.3 (2020-Sep-22) + * @version jsrsasign 10.0.1 asn1x509 2.1.4 (2020-Oct-12) * @since jsrsasign 2.1 * @license MIT License */ @@ -456,6 +456,8 @@ KJUR.asn1.x509.Extensions = function(aParam) { obj = new _KJUR_asn1_x509.OCSPNonce(param); } else if (extname == "ocspNoCheck") { obj = new _KJUR_asn1_x509.OCSPNoCheck(param); + } else if (extname == "adobeTimeStamp") { + obj = new _KJUR_asn1_x509.AdobeTimeStamp(param); } else { throw new Error("extension not supported:" + JSON.stringify(param)); @@ -2528,6 +2530,73 @@ YAHOO.lang.extend(KJUR.asn1.x509.OCSPNoCheck, KJUR.asn1.x509.Extension); // === END OCSP Related =================================================== +// === BEGIN Other X.509v3 Extensions======================================== + +/** + * AdobeTimeStamp X.509v3 extension ASN.1 encoder class
    + * @name KJUR.asn1.x509.AdobeTimeStamp + * @class AdobeTimeStamp X.509v3 extension ASN.1 encoder class + * @extends KJUR.asn1.x509.Extension + * @since jsrsasign 10.0.1 asn1x509 2.1.4 + * @param {Array} params JSON object for AdobeTimeStamp extension parameter + * @see KJUR.asn1.x509.Extensions + * @see X509#getExtAdobeTimeStamp + * @description + * This class represents + * AdobeTimeStamp X.509v3 extension value defined in + * + * Adobe site as JSON object. + *
    + * adbe- OBJECT IDENTIFIER ::=  { adbe(1.2.840.113583) acrobat(1) security(1) x509Ext(9) 1 }
    + *  ::= SEQUENCE {
    + *     version INTEGER  { v1(1) }, -- extension version
    + *     location GeneralName (In v1 GeneralName can be only uniformResourceIdentifier)
    + *     requiresAuth        boolean (default false), OPTIONAL }
    + * 
    + * Constructor of this class may have following parameters: + *
      + *
    • {String}uri - RFC 3161 time stamp service URL
    • + *
    • {Boolean}reqauth - authentication required or not
    • + *
    + * + * @example + * new KJUR.asn1.x509.AdobeTimesStamp({ + * uri: "http://tsa.example.com/", + * reqauth: true + * } + */ +KJUR.asn1.x509.AdobeTimeStamp = function(params) { + KJUR.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this, params); + + var _KJUR = KJUR, + _KJUR_asn1 = _KJUR.asn1, + _DERInteger = _KJUR_asn1.DERInteger, + _DERBoolean = _KJUR_asn1.DERBoolean, + _DERSequence = _KJUR_asn1.DERSequence, + _GeneralName = _KJUR_asn1.x509.GeneralName; + + this.params = null; + + this.getExtnValueHex = function() { + var params = this.params; + var a = [new _DERInteger(1)]; + a.push(new _GeneralName({uri: params.uri})); + if (params.reqauth != undefined) { + a.push(new _DERBoolean(params.reqauth)); + } + + this.asn1ExtnValue = new _DERSequence({array: a}); + return this.asn1ExtnValue.getEncodedHex(); + }; + + this.oid = "1.2.840.113583.1.1.9.1"; + if (params !== undefined) this.setByParam(params); +}; +YAHOO.lang.extend(KJUR.asn1.x509.AdobeTimeStamp, KJUR.asn1.x509.Extension); + +// === END Other X.509v3 Extensions======================================== + + // === BEGIN X500Name Related ================================================= /** * X500Name ASN.1 structure class @@ -3924,7 +3993,8 @@ KJUR.asn1.x509.OID = new function(params) { 'signingTime': '1.2.840.113549.1.9.5',//PKCS#9 'counterSignature': '1.2.840.113549.1.9.6',//PKCS#9 'archiveTimeStampV3': '0.4.0.1733.2.4',//ETSI EN29319122/TS101733 - 'pdfRevocationInfoArchival':'1.2.840.113583.1.1.8'//Adobe + 'pdfRevocationInfoArchival':'1.2.840.113583.1.1.8', //Adobe + 'adobeTimeStamp': '1.2.840.113583.1.1.9.1' // Adobe }; this.objCache = {}; diff --git a/src/x509-1.1.js b/src/x509-1.1.js index f752e6e0..b9711c90 100644 --- a/src/x509-1.1.js +++ b/src/x509-1.1.js @@ -1,4 +1,4 @@ -/* x509-2.0.4.js (c) 2012-2020 Kenji Urushima | kjur.github.io/jsrsasign/license +/* x509-2.0.5.js (c) 2012-2020 Kenji Urushima | kjur.github.io/jsrsasign/license */ /* * x509.js - X509 class to read subject public key from certificate. @@ -16,7 +16,7 @@ * @fileOverview * @name x509-1.1.js * @author Kenji Urushima kenji.urushima@gmail.com - * @version jsrsasign 10.0.0 x509 2.0.4 (2020-Sep-22) + * @version jsrsasign 10.0.1 x509 2.0.5 (2020-Oct-11) * @since jsrsasign 1.x.x * @license MIT License */ @@ -1938,6 +1938,66 @@ function X509(params) { return result; }; + /** + * parse AdobeTimeStamp extension as JSON object
    + * @name getExtAdobeTimeStamp + * @memberOf X509# + * @function + * @param {String} hExtV hexadecimal string of extension value + * @param {Boolean} critical flag + * @return {Array} JSON object of parsed AdobeTimeStamp extension + * @since jsrsasign 10.0.1 x509 2.0.5 + * @see {@link KJUR.asn1.x509.AdobeTimeStamp} + * @see {@link X509#getExtParamArray} + * @see {@link X509#getExtParam} + * @description + * This method parses + * X.509v3 AdobeTimeStamp private extension value defined in the + * + * Adobe site as JSON object. + * This extension provides the URL location for time stamp service. + *
    +     * adbe- OBJECT IDENTIFIER ::=  { adbe(1.2.840.113583) acrobat(1) security(1) x509Ext(9) 1 }
    +     *  ::= SEQUENCE {
    +     *     version INTEGER  { v1(1) }, -- extension version
    +     *     location GeneralName (In v1 GeneralName can be only uniformResourceIdentifier)
    +     *     requiresAuth        boolean (default false), OPTIONAL }
    +     * 
    + *
    + * Result of this method can be passed to + * {@link KJUR.asn1.x509.AdobeTimeStamp} constructor. + * @example + * x.getExtAdobeTimeStamp(<>) → + * { extname: "adobeTimeStamp", uri: "http://tsa.example.com/" reqauth: true } + */ + this.getExtAdobeTimeStamp = function(hExtV, critical) { + if (hExtV === undefined && critical === undefined) { + var info = this.getExtInfo("adobeTimeStamp"); + if (info === undefined) return undefined; + hExtV = _getTLV(this.hex, info.vidx); + critical = info.critical; + } + + var result = {extname:"adobeTimeStamp"}; + if (critical) result.critical = true; + + var a = _getChildIdx(hExtV, 0); + if (a.length > 1) { + var hGN = _getTLV(hExtV, a[1]) + var gnParam = this.getGeneraName(hGN); + if (gnParam.uri != undefined) { + result.uri = gnParam.uri; + } + } + if (a.length > 2) { + var hBool = _getTLV(hExtV, a[2]); + if (hBool == "0101ff") result.reqauth = true; + if (hBool == "010100") result.reqauth = false; + } + + return result; + }; + // ===== BEGIN X500Name related ===================================== this.getX500NameRule = function(aDN) { @@ -2337,6 +2397,8 @@ function X509(params) { extParam = this.getExtOcspNonce(hExtV, critical); } else if (oid == "1.3.6.1.5.5.7.48.1.5") { extParam = this.getExtOcspNoCheck(hExtV, critical); + } else if (oid == "1.2.840.113583.1.1.9.1") { + extParam = this.getExtAdobeTimeStamp(hExtV, critical); } if (extParam != undefined) return extParam; diff --git a/test/qunit-do-asn1.html b/test/qunit-do-asn1.html index 40619e22..7c4924b8 100755 --- a/test/qunit-do-asn1.html +++ b/test/qunit-do-asn1.html @@ -43,9 +43,8 @@ }); test("Boolean Test", function() { - var d = new KJUR.asn1.DERBoolean(); - expect(1); - equal(d.getEncodedHex(), "0101ff", "Boolean TRUE"); + equal(new KJUR.asn1.DERBoolean(true).getEncodedHex(), "0101ff", "Boolean TRUE"); + equal(new KJUR.asn1.DERBoolean(false).getEncodedHex(), "010100", "Boolean TRUE"); }); test("Integer Test", function() { diff --git a/test/qunit-do-asn1x509.html b/test/qunit-do-asn1x509.html index 789dfcdf..32ed4c46 100755 --- a/test/qunit-do-asn1x509.html +++ b/test/qunit-do-asn1x509.html @@ -991,6 +991,46 @@ "dump"); }); +test("AdobeTimeStamp class test", function() { +var _AdobeTimeStamp = KJUR.asn1.x509.AdobeTimeStamp; + +var hExpect = "302b060a2a864886f72f01010901041d301b0201018613687474703a2f2f6578616d706c652e636f6d2f0101ff"; +var param = { + uri: "http://example.com/", + reqauth: true +}; +var o = new _AdobeTimeStamp(param); +equal(o.getEncodedHex(), hExpect, "hex"); +equal( +ASN1HEX.dump(o.getEncodedHex()), +ASN1HEX.dump(hExpect), +"dump"); + +var hExpect2 = "302b060a2a864886f72f01010901041d301b0201018613687474703a2f2f6578616d706c652e636f6d2f010100"; +var param2 = { + uri: "http://example.com/", + reqauth: false +}; +var o2 = new _AdobeTimeStamp(param2); +equal(o2.getEncodedHex(), hExpect2, "hex"); +equal( +ASN1HEX.dump(o2.getEncodedHex()), +ASN1HEX.dump(hExpect2), +"dump"); + +var hExpect3 = "3028060a2a864886f72f01010901041a30180201018613687474703a2f2f6578616d706c652e636f6d2f"; +var param3 = { + uri: "http://example.com/" +}; +var o3 = new _AdobeTimeStamp(param3); +equal(o3.getEncodedHex(), hExpect3, "hex"); +equal( +ASN1HEX.dump(o3.getEncodedHex()), +ASN1HEX.dump(hExpect3), +"dump"); + +}); + test("PrivateExtension class test", function() { var _PrivateExtension = KJUR.asn1.x509.PrivateExtension; hExpect = "300c06032a030404051303616161";