diff --git a/ChangeLog.txt b/ChangeLog.txt index 7409a92e..30343c69 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,21 @@ ChangeLog for jsrsasign +add CertificatePolicies BMPString and VisibleString support +* Changes from 8.0.22 to 8.0.23 (2020-Aug-06) + - src/asn1x509.js + - CertificatePolicies class added + - update Estension.appendByNameToArray for + CertificatePolicies + - PolicyInformation, PolicyQualifierInfo, UserNotice, + NoticeReference and DisplayText class added + - src/asn1.js + - BMPString and VisibleString class added + - update ASN1Util.newObject for {BMP,Visible}String + - src/asn1hex.js + - update ASN1HEX.dump for {BMP,Visible}String + - test qunit-do-{asn1,asn1-newobj,asn1x509,asn1hex-dump}.html + ASN1HEX and X509 class minior bug fix * Changes from 8.0.21 to 8.0.22 (2020-Aug-05) - src/asn1hex.js diff --git a/Makefile b/Makefile index 9603bf2d..319c4b6a 100644 --- a/Makefile +++ b/Makefile @@ -37,3 +37,9 @@ min/%.min.js: src/%.js ext/%-min.js: ext/%.js yuicmp $^ -o $@ + +gitadd-all-doc: + git add api/*.html api/symbols/*.html api/symbols/src/*.html + +gitadd-release: + git add ChangeLog.txt Makefile bower.json jsrsasign-*-min.js min/*.js src/*.js npm/package.json npm/lib/jsrsasign*.js src/*.js test/qunit-do-*.html diff --git a/api/files.html b/api/files.html index 7f3472c2..4bd006d1 100644 --- a/api/files.html +++ b/api/files.html @@ -262,6 +262,8 @@

Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -294,6 +296,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -348,12 +352,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -370,8 +378,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -386,6 +400,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -443,7 +459,7 @@

    asn1-1.0.js

    Version:
    -
    asn1 1.0.14 (2018-Apr-03)
    +
    asn1 1.0.15 (2020-Aug-05)
    @@ -576,7 +592,7 @@

    asn1x509-1.0.js

    Version:
    -
    jsrsasign 8.0.21 asn1x509 1.1.11 (2020-Jul-28)
    +
    jsrsasign 8.0.23 asn1x509 1.1.12 (2020-Apr-06)
    diff --git a/api/index.html b/api/index.html index e57065c8..d8cea852 100644 --- a/api/index.html +++ b/api/index.html @@ -262,6 +262,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -294,6 +296,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -348,12 +352,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -370,8 +378,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -386,6 +400,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -660,6 +676,12 @@

    KJUR.asn1.DERBitString


    +
    +

    KJUR.asn1.DERBMPString

    + class for ASN.1 DER BMPString +
    +
    +

    KJUR.asn1.DERBoolean

    class for ASN.1 DER Boolean @@ -756,6 +778,12 @@

    KJUR.asn1.DERUTF8String
    +
    +

    KJUR.asn1.DERVisibleString

    + class for ASN.1 DER VisibleString +
    +
    +

    KJUR.asn1.ocsp

    @@ -918,6 +946,12 @@

    KJUR.asn1.x509.Certificate


    +
    +

    KJUR.asn1.x509.CertificatePolicies

    + CertificatePolicies ASN.1 structure class +
    +
    +

    KJUR.asn1.x509.CRL

    X.509 CRL class to sign and generate hex encoded certificate @@ -936,6 +970,12 @@

    KJUR.asn1.x509.CRLEntry
    +
    +

    KJUR.asn1.x509.DisplayText

    + DisplayText ASN.1 structure class +
    +
    +

    KJUR.asn1.x509.DistributionPoint

    DistributionPoint ASN.1 structure class @@ -984,12 +1024,30 @@

    KJUR.asn1.x509.KeyUsage
    +
    +

    KJUR.asn1.x509.NoticeReference

    + NoticeReference ASN.1 structure class +
    +
    +

    KJUR.asn1.x509.OID

    static object for OID

    +
    +

    KJUR.asn1.x509.PolicyInformation

    + PolicyInformation ASN.1 structure class +
    +
    + +
    +

    KJUR.asn1.x509.PolicyQualifierInfo

    + PolicyQualifierInfo ASN.1 structure class +
    +
    +

    KJUR.asn1.x509.RDN

    RDN (Relative Distinguished Name) ASN.1 structure class @@ -1032,6 +1090,12 @@

    KJUR.asn1.x509.Time


    +
    +

    KJUR.asn1.x509.UserNotice

    + UserNotice ASN.1 structure class +
    +
    +

    KJUR.asn1.x509.X500Name

    X500Name ASN.1 structure class diff --git a/api/symbols/ASN1HEX.html b/api/symbols/ASN1HEX.html index 20c75d4b..f2bc18d5 100644 --- a/api/symbols/ASN1HEX.html +++ b/api/symbols/ASN1HEX.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/Base64x.html b/api/symbols/Base64x.html index 7b864a2f..83999414 100644 --- a/api/symbols/Base64x.html +++ b/api/symbols/Base64x.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KEYUTIL.html b/api/symbols/KEYUTIL.html index acfcc7dc..e2da7e2a 100644 --- a/api/symbols/KEYUTIL.html +++ b/api/symbols/KEYUTIL.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ASN1Object.html b/api/symbols/KJUR.asn1.ASN1Object.html index 2951e74a..6189bdca 100644 --- a/api/symbols/KJUR.asn1.ASN1Object.html +++ b/api/symbols/KJUR.asn1.ASN1Object.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ASN1Util.html b/api/symbols/KJUR.asn1.ASN1Util.html index 872f092e..d993d35e 100644 --- a/api/symbols/KJUR.asn1.ASN1Util.html +++ b/api/symbols/KJUR.asn1.ASN1Util.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -746,6 +762,8 @@

  • 'ia5str' - DERIA5String
  • 'utctime' - DERUTCTime
  • 'gentime' - DERGeneralizedTime
  • +
  • 'visstr' - DERVisibleString
  • +
  • 'bmpstr' - DERBMPString
  • 'seq' - DERSequence
  • 'set' - DERSet
  • 'tag' - DERTaggedObject
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractString.html b/api/symbols/KJUR.asn1.DERAbstractString.html index 117890fe..20d2775f 100644 --- a/api/symbols/KJUR.asn1.DERAbstractString.html +++ b/api/symbols/KJUR.asn1.DERAbstractString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractStructured.html b/api/symbols/KJUR.asn1.DERAbstractStructured.html index 0f6a22fa..07fa75a3 100644 --- a/api/symbols/KJUR.asn1.DERAbstractStructured.html +++ b/api/symbols/KJUR.asn1.DERAbstractStructured.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractTime.html b/api/symbols/KJUR.asn1.DERAbstractTime.html index 208e72f6..83ad1c0a 100644 --- a/api/symbols/KJUR.asn1.DERAbstractTime.html +++ b/api/symbols/KJUR.asn1.DERAbstractTime.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERBMPString.html b/api/symbols/KJUR.asn1.DERBMPString.html new file mode 100644 index 00000000..845aad2a --- /dev/null +++ b/api/symbols/KJUR.asn1.DERBMPString.html @@ -0,0 +1,599 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.DERBMPString + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.DERBMPString +

    + + +

    + +
    Extends + KJUR.asn1.DERAbstractString.
    + + + class for ASN.1 DER BMPString + + +
    Defined in: asn1-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    class for ASN.1 DER BMPString +
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.DERAbstractString:
    s
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.DERAbstractString:
    getString, setString, setStringHex
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.DERBMPString(params) +
    + +
    + class for ASN.1 DER BMPString + + +
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters (ex. {'str': 'aaa'})
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1 1.0.15
    +
    + + + + + +
    +
    See:
    + +
    KJUR.asn1.DERAbstractString - superclass
    + +
    + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.DERBitString.html b/api/symbols/KJUR.asn1.DERBitString.html index 18ce301a..e3b17440 100644 --- a/api/symbols/KJUR.asn1.DERBitString.html +++ b/api/symbols/KJUR.asn1.DERBitString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERBoolean.html b/api/symbols/KJUR.asn1.DERBoolean.html index 1ebe51cb..d58be3b5 100644 --- a/api/symbols/KJUR.asn1.DERBoolean.html +++ b/api/symbols/KJUR.asn1.DERBoolean.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DEREnumerated.html b/api/symbols/KJUR.asn1.DEREnumerated.html index 7e76f0b9..f77450aa 100644 --- a/api/symbols/KJUR.asn1.DEREnumerated.html +++ b/api/symbols/KJUR.asn1.DEREnumerated.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERGeneralizedTime.html b/api/symbols/KJUR.asn1.DERGeneralizedTime.html index c2a09f07..96d4c8df 100644 --- a/api/symbols/KJUR.asn1.DERGeneralizedTime.html +++ b/api/symbols/KJUR.asn1.DERGeneralizedTime.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERIA5String.html b/api/symbols/KJUR.asn1.DERIA5String.html index e52e36e2..e6433d6b 100644 --- a/api/symbols/KJUR.asn1.DERIA5String.html +++ b/api/symbols/KJUR.asn1.DERIA5String.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERInteger.html b/api/symbols/KJUR.asn1.DERInteger.html index a128e46a..2bd9ffb2 100644 --- a/api/symbols/KJUR.asn1.DERInteger.html +++ b/api/symbols/KJUR.asn1.DERInteger.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERNull.html b/api/symbols/KJUR.asn1.DERNull.html index b16ffe2b..431264d2 100644 --- a/api/symbols/KJUR.asn1.DERNull.html +++ b/api/symbols/KJUR.asn1.DERNull.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERNumericString.html b/api/symbols/KJUR.asn1.DERNumericString.html index fbb7be6b..116aef33 100644 --- a/api/symbols/KJUR.asn1.DERNumericString.html +++ b/api/symbols/KJUR.asn1.DERNumericString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERObjectIdentifier.html b/api/symbols/KJUR.asn1.DERObjectIdentifier.html index 3b24ee9b..07e3d63c 100644 --- a/api/symbols/KJUR.asn1.DERObjectIdentifier.html +++ b/api/symbols/KJUR.asn1.DERObjectIdentifier.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DEROctetString.html b/api/symbols/KJUR.asn1.DEROctetString.html index b1715649..21a89078 100644 --- a/api/symbols/KJUR.asn1.DEROctetString.html +++ b/api/symbols/KJUR.asn1.DEROctetString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERPrintableString.html b/api/symbols/KJUR.asn1.DERPrintableString.html index 61ae60b2..4b448324 100644 --- a/api/symbols/KJUR.asn1.DERPrintableString.html +++ b/api/symbols/KJUR.asn1.DERPrintableString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERSequence.html b/api/symbols/KJUR.asn1.DERSequence.html index 5da8ce55..fea973b5 100644 --- a/api/symbols/KJUR.asn1.DERSequence.html +++ b/api/symbols/KJUR.asn1.DERSequence.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERSet.html b/api/symbols/KJUR.asn1.DERSet.html index 1aa0f8e3..5a32cdd0 100644 --- a/api/symbols/KJUR.asn1.DERSet.html +++ b/api/symbols/KJUR.asn1.DERSet.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERTaggedObject.html b/api/symbols/KJUR.asn1.DERTaggedObject.html index c5b6d87d..bf330290 100644 --- a/api/symbols/KJUR.asn1.DERTaggedObject.html +++ b/api/symbols/KJUR.asn1.DERTaggedObject.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERTeletexString.html b/api/symbols/KJUR.asn1.DERTeletexString.html index 28645336..77a0bdde 100644 --- a/api/symbols/KJUR.asn1.DERTeletexString.html +++ b/api/symbols/KJUR.asn1.DERTeletexString.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERUTCTime.html b/api/symbols/KJUR.asn1.DERUTCTime.html index 64d31048..39d93e9f 100644 --- a/api/symbols/KJUR.asn1.DERUTCTime.html +++ b/api/symbols/KJUR.asn1.DERUTCTime.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERUTF8String.html b/api/symbols/KJUR.asn1.DERUTF8String.html index 20543a41..1398e09a 100644 --- a/api/symbols/KJUR.asn1.DERUTF8String.html +++ b/api/symbols/KJUR.asn1.DERUTF8String.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.DERVisibleString.html b/api/symbols/KJUR.asn1.DERVisibleString.html new file mode 100644 index 00000000..c0b30813 --- /dev/null +++ b/api/symbols/KJUR.asn1.DERVisibleString.html @@ -0,0 +1,599 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.DERVisibleString + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.DERVisibleString +

    + + +

    + +
    Extends + KJUR.asn1.DERAbstractString.
    + + + class for ASN.1 DER VisibleString + + +
    Defined in: asn1-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    class for ASN.1 DER VisibleString +
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.DERAbstractString:
    s
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.DERAbstractString:
    getString, setString, setStringHex
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.DERVisibleString(params) +
    + +
    + class for ASN.1 DER VisibleString + + +
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters (ex. {'str': 'aaa'})
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1 1.0.15
    +
    + + + + + +
    +
    See:
    + +
    KJUR.asn1.DERAbstractString - superclass
    + +
    + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.cades.CAdESUtil.html b/api/symbols/KJUR.asn1.cades.CAdESUtil.html index 2364e0bf..e2a6d61e 100644 --- a/api/symbols/KJUR.asn1.cades.CAdESUtil.html +++ b/api/symbols/KJUR.asn1.cades.CAdESUtil.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html index 14a687c7..2356766b 100644 --- a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html +++ b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherCertID.html b/api/symbols/KJUR.asn1.cades.OtherCertID.html index ddbf4e50..ed15c2e5 100644 --- a/api/symbols/KJUR.asn1.cades.OtherCertID.html +++ b/api/symbols/KJUR.asn1.cades.OtherCertID.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHash.html b/api/symbols/KJUR.asn1.cades.OtherHash.html index 84852458..9a358077 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHash.html +++ b/api/symbols/KJUR.asn1.cades.OtherHash.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html index f3dd5d65..76fa9a40 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html index 1ea2c8b5..185c94a8 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html index 6cdc8692..3a291119 100644 --- a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html +++ b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cades.html b/api/symbols/KJUR.asn1.cades.html index e7b1f1d4..d6c3d528 100644 --- a/api/symbols/KJUR.asn1.cades.html +++ b/api/symbols/KJUR.asn1.cades.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.Attribute.html b/api/symbols/KJUR.asn1.cms.Attribute.html index 49cc62ad..5a472376 100644 --- a/api/symbols/KJUR.asn1.cms.Attribute.html +++ b/api/symbols/KJUR.asn1.cms.Attribute.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.AttributeList.html b/api/symbols/KJUR.asn1.cms.AttributeList.html index 3c44e81f..0130f47b 100644 --- a/api/symbols/KJUR.asn1.cms.AttributeList.html +++ b/api/symbols/KJUR.asn1.cms.AttributeList.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.CMSUtil.html b/api/symbols/KJUR.asn1.cms.CMSUtil.html index ac6597be..252024e8 100644 --- a/api/symbols/KJUR.asn1.cms.CMSUtil.html +++ b/api/symbols/KJUR.asn1.cms.CMSUtil.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentInfo.html b/api/symbols/KJUR.asn1.cms.ContentInfo.html index fcdd11d8..0e9f4f38 100644 --- a/api/symbols/KJUR.asn1.cms.ContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.ContentInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentType.html b/api/symbols/KJUR.asn1.cms.ContentType.html index 1727abd2..329bbb90 100644 --- a/api/symbols/KJUR.asn1.cms.ContentType.html +++ b/api/symbols/KJUR.asn1.cms.ContentType.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html index f84223ad..c087404c 100644 --- a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html index 087ba858..5cee76c7 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html +++ b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.MessageDigest.html b/api/symbols/KJUR.asn1.cms.MessageDigest.html index 7f1a03fd..b21fa334 100644 --- a/api/symbols/KJUR.asn1.cms.MessageDigest.html +++ b/api/symbols/KJUR.asn1.cms.MessageDigest.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.SignedData.html b/api/symbols/KJUR.asn1.cms.SignedData.html index 8f36ba7f..d4ce05ed 100644 --- a/api/symbols/KJUR.asn1.cms.SignedData.html +++ b/api/symbols/KJUR.asn1.cms.SignedData.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerInfo.html b/api/symbols/KJUR.asn1.cms.SignerInfo.html index ef9462fb..8d6a5fc0 100644 --- a/api/symbols/KJUR.asn1.cms.SignerInfo.html +++ b/api/symbols/KJUR.asn1.cms.SignerInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificate.html b/api/symbols/KJUR.asn1.cms.SigningCertificate.html index edf41d21..8a6b279d 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificate.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificate.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html index 504d7a48..67ee598c 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningTime.html b/api/symbols/KJUR.asn1.cms.SigningTime.html index 9940e855..0a3e5de9 100644 --- a/api/symbols/KJUR.asn1.cms.SigningTime.html +++ b/api/symbols/KJUR.asn1.cms.SigningTime.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.cms.html b/api/symbols/KJUR.asn1.cms.html index 469375d1..7b4fa811 100644 --- a/api/symbols/KJUR.asn1.cms.html +++ b/api/symbols/KJUR.asn1.cms.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.csr.CSRUtil.html b/api/symbols/KJUR.asn1.csr.CSRUtil.html index d858e808..c8176b94 100644 --- a/api/symbols/KJUR.asn1.csr.CSRUtil.html +++ b/api/symbols/KJUR.asn1.csr.CSRUtil.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequest.html b/api/symbols/KJUR.asn1.csr.CertificationRequest.html index 6459497c..9aea81b7 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequest.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequest.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html index 862d2a9d..ed2b0a30 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.csr.html b/api/symbols/KJUR.asn1.csr.html index cddafc6b..cc635c3d 100644 --- a/api/symbols/KJUR.asn1.csr.html +++ b/api/symbols/KJUR.asn1.csr.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.html b/api/symbols/KJUR.asn1.html index d927b5e5..c8bcf57c 100644 --- a/api/symbols/KJUR.asn1.html +++ b/api/symbols/KJUR.asn1.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -611,6 +627,8 @@

    PROVIDING ASN.1 PRIMITIVES

  • 0x16 KJUR.asn1.DERIA5String
  • 0x17 KJUR.asn1.DERUTCTime
  • 0x18 KJUR.asn1.DERGeneralizedTime
  • +
  • 0x1a KJUR.asn1.DERVisibleString
  • +
  • 0x1e KJUR.asn1.DERBMPString
  • 0x30 KJUR.asn1.DERSequence
  • 0x31 KJUR.asn1.DERSet
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertID.html b/api/symbols/KJUR.asn1.ocsp.CertID.html index 082341a1..1e0ebbc8 100644 --- a/api/symbols/KJUR.asn1.ocsp.CertID.html +++ b/api/symbols/KJUR.asn1.ocsp.CertID.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html index a5a0c1c9..90304b0c 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html index cb87492c..1171eb5c 100644 --- a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html +++ b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ocsp.Request.html b/api/symbols/KJUR.asn1.ocsp.Request.html index f085313b..526da733 100644 --- a/api/symbols/KJUR.asn1.ocsp.Request.html +++ b/api/symbols/KJUR.asn1.ocsp.Request.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html index f47f6a18..042cfca9 100644 --- a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html +++ b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.ocsp.html b/api/symbols/KJUR.asn1.ocsp.html index 96d541b2..7ff965a3 100644 --- a/api/symbols/KJUR.asn1.ocsp.html +++ b/api/symbols/KJUR.asn1.ocsp.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html index 9d2b4019..e215e560 100644 --- a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.Accuracy.html b/api/symbols/KJUR.asn1.tsp.Accuracy.html index 400ea7e4..5995af7f 100644 --- a/api/symbols/KJUR.asn1.tsp.Accuracy.html +++ b/api/symbols/KJUR.asn1.tsp.Accuracy.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html index 1665546b..d365d094 100644 --- a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.MessageImprint.html b/api/symbols/KJUR.asn1.tsp.MessageImprint.html index e2107161..aff47def 100644 --- a/api/symbols/KJUR.asn1.tsp.MessageImprint.html +++ b/api/symbols/KJUR.asn1.tsp.MessageImprint.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html index 4085ab93..3bef70eb 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html index 9b7a0c8f..f77024f8 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatus.html b/api/symbols/KJUR.asn1.tsp.PKIStatus.html index 4130014c..24914e3a 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatus.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatus.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html index 6fe0bc59..70bbbac1 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html index c724c445..1c8a9fda 100644 --- a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSPUtil.html b/api/symbols/KJUR.asn1.tsp.TSPUtil.html index 925c7a07..e7f428eb 100644 --- a/api/symbols/KJUR.asn1.tsp.TSPUtil.html +++ b/api/symbols/KJUR.asn1.tsp.TSPUtil.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSTInfo.html b/api/symbols/KJUR.asn1.tsp.TSTInfo.html index 69ca2fc7..b953b295 100644 --- a/api/symbols/KJUR.asn1.tsp.TSTInfo.html +++ b/api/symbols/KJUR.asn1.tsp.TSTInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html index b9995516..d83ac014 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html index 54b9b7a8..2db4f974 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.tsp.html b/api/symbols/KJUR.asn1.tsp.html index 24e93471..443da4ed 100644 --- a/api/symbols/KJUR.asn1.tsp.html +++ b/api/symbols/KJUR.asn1.tsp.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html index 36fd2b54..f82c2758 100644 --- a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html index b89c8f97..780d9824 100644 --- a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html +++ b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html index 8f63ede1..083d9e77 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityInfoAccess.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html index 69ffb9fb..2bea5758 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.BasicConstraints.html b/api/symbols/KJUR.asn1.x509.BasicConstraints.html index 2fe9b7aa..83548cbd 100644 --- a/api/symbols/KJUR.asn1.x509.BasicConstraints.html +++ b/api/symbols/KJUR.asn1.x509.BasicConstraints.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.CRL.html b/api/symbols/KJUR.asn1.x509.CRL.html index 69617887..5c2ef567 100644 --- a/api/symbols/KJUR.asn1.x509.CRL.html +++ b/api/symbols/KJUR.asn1.x509.CRL.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html index 2cb327a1..135bb2b9 100644 --- a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html +++ b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLEntry.html b/api/symbols/KJUR.asn1.x509.CRLEntry.html index 74f61861..368153d7 100644 --- a/api/symbols/KJUR.asn1.x509.CRLEntry.html +++ b/api/symbols/KJUR.asn1.x509.CRLEntry.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.Certificate.html b/api/symbols/KJUR.asn1.x509.Certificate.html index a0ca4dee..5a0224eb 100644 --- a/api/symbols/KJUR.asn1.x509.Certificate.html +++ b/api/symbols/KJUR.asn1.x509.Certificate.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.CertificatePolicies.html b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html new file mode 100644 index 00000000..7d552991 --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.CertificatePolicies.html @@ -0,0 +1,625 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.CertificatePolicies + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.CertificatePolicies +

    + + +

    + +
    Extends + KJUR.asn1.x509.Extension.
    + + + CertificatePolicies ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    CertificatePolicies ASN.1 structure class +This class represents + +CertificatePolicies extension defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.CertificatePolicies(params) +
    + +
    + CertificatePolicies ASN.1 structure class +This class represents + +CertificatePolicies extension defined in RFC 5280 4.2.1.4. +
    +id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }
    +CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
    +
    +Its constructor can have following parameters: + + +
    + + + +
    e1 = new KJUR.asn1.x509.CertificatePolicies({
    +  array: [
    +    { policyoid: "1.2.3.4.5",
    +      array: [
    +        { cps: "https://example.com/repository" },
    +        { unotice: {
    +          noticeref: { // CA SHOULD NOT use this by RFC
    +            org: {type: "ia5", str: "Sample Org"},
    +            noticenum: [{int: 5}, {hex: "01af"}]
    +          },
    +          exptext: {type: "ia5", str: "Sample Policy"}
    +        }}
    +      ]
    +    }
    +  ],
    +  critical: true
    +});
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.DisplayText.html b/api/symbols/KJUR.asn1.x509.DisplayText.html new file mode 100644 index 00000000..0998f97e --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.DisplayText.html @@ -0,0 +1,619 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.DisplayText + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.DisplayText +

    + + +

    + +
    Extends + KJUR.asn1.DERAbstractString.
    + + + DisplayText ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    DisplayText ASN.1 structure class +This class represents + +DisplayText defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.DERAbstractString:
    s
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.DERAbstractString:
    getString, setString, setStringHex
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.DisplayText(params) +
    + +
    + DisplayText ASN.1 structure class +This class represents + +DisplayText defined in RFC 5280 4.2.1.4. +
    +-- from RFC 5280 Appendix A
    +DisplayText ::= CHOICE {
    +     ia5String        IA5String      (SIZE (1..200)),
    +     visibleString    VisibleString  (SIZE (1..200)),
    +     bmpString        BMPString      (SIZE (1..200)),
    +     utf8String       UTF8String     (SIZE (1..200)) }
    +
    +KJUR.asn1.DERAbstractString parameters and methods +can be used. +Its constructor can also have following parameter: +
      +
    • {String} type - DirectoryString type of DisplayText. +"ia5" for IA5String, "vis" for VisibleString, +"bmp" for BMPString and "utf8" for UTF8String. +Default is "utf8". (OPTIONAL)
    • +
    + +
    + + + +
    new DisplayText({type: "bmp", str: "Sample Org"})
    +new DisplayText({type: "ia5", str: "Sample Org"})
    +new DisplayText({str: "Sample Org"})
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.DistributionPoint.html b/api/symbols/KJUR.asn1.x509.DistributionPoint.html index 93b8ec82..1ab5a8ef 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPoint.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPoint.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPointName.html b/api/symbols/KJUR.asn1.x509.DistributionPointName.html index 8683d6f0..0cc3b801 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPointName.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPointName.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html index e25e935b..6b4f0367 100644 --- a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.Extension.html b/api/symbols/KJUR.asn1.x509.Extension.html index 903dbd78..1f94e7f3 100644 --- a/api/symbols/KJUR.asn1.x509.Extension.html +++ b/api/symbols/KJUR.asn1.x509.Extension.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralName.html b/api/symbols/KJUR.asn1.x509.GeneralName.html index d0832454..93cf6cef 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralName.html +++ b/api/symbols/KJUR.asn1.x509.GeneralName.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralNames.html b/api/symbols/KJUR.asn1.x509.GeneralNames.html index 469482a7..3ce97ddb 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralNames.html +++ b/api/symbols/KJUR.asn1.x509.GeneralNames.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.IssuerAltName.html b/api/symbols/KJUR.asn1.x509.IssuerAltName.html index ed2a71a2..4d54cf5f 100644 --- a/api/symbols/KJUR.asn1.x509.IssuerAltName.html +++ b/api/symbols/KJUR.asn1.x509.IssuerAltName.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.KeyUsage.html b/api/symbols/KJUR.asn1.x509.KeyUsage.html index c1e19a82..e6bf3d93 100644 --- a/api/symbols/KJUR.asn1.x509.KeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.KeyUsage.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.NoticeReference.html b/api/symbols/KJUR.asn1.x509.NoticeReference.html new file mode 100644 index 00000000..596cd7c3 --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.NoticeReference.html @@ -0,0 +1,615 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.NoticeReference + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.NoticeReference +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + NoticeReference ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    NoticeReference ASN.1 structure class +This class represents + +NoticeReference defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.NoticeReference(params) +
    + +
    + NoticeReference ASN.1 structure class +This class represents + +NoticeReference defined in RFC 5280 4.2.1.4. +
    +NoticeReference ::= SEQUENCE {
    +     organization     DisplayText,
    +     noticeNumbers    SEQUENCE OF INTEGER }
    +
    +Its constructor can have following two parameters: + + +
    + + + +
    new NoticeReference({
    +  org: {type: "bmp", str: "Sample Org"},
    +  noticenum: [{int: 3}, {hex: "01af"}]
    +})
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.OID.html b/api/symbols/KJUR.asn1.x509.OID.html index 6bab3be2..3fd6d410 100644 --- a/api/symbols/KJUR.asn1.x509.OID.html +++ b/api/symbols/KJUR.asn1.x509.OID.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.PolicyInformation.html b/api/symbols/KJUR.asn1.x509.PolicyInformation.html new file mode 100644 index 00000000..b4adb8ab --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.PolicyInformation.html @@ -0,0 +1,624 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.PolicyInformation + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.PolicyInformation +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + PolicyInformation ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    PolicyInformation ASN.1 structure class +This class represents + +PolicyInformation defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.PolicyInformation(params) +
    + +
    + PolicyInformation ASN.1 structure class +This class represents + +PolicyInformation defined in RFC 5280 4.2.1.4. +
    +PolicyInformation ::= SEQUENCE {
    +     policyIdentifier   CertPolicyId,
    +     policyQualifiers   SEQUENCE SIZE (1..MAX) OF
    +                        PolicyQualifierInfo OPTIONAL }
    +CertPolicyId ::= OBJECT IDENTIFIER
    +Its constructor can have following parameters:
    +
    +					
    +				
    + + + +
    new KJUR.asn1.x509.PolicyInformation({
    +  policyoid: "1.2.3.4.5",
    +  array: [
    +    { cps: "https://example.com/repository" },
    +    { unotice: {
    +      noticeref: { // CA SHOULD NOT use this by RFC
    +        org: {type: "ia5", str: "Sample Org"},
    +        noticenum: [{int: 5}, {hex: "01af"}]
    +      },
    +      exptext: {type: "ia5", str: "Sample Policy"}
    +    }}
    +  ]
    +})
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html new file mode 100644 index 00000000..d65eca7c --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.PolicyQualifierInfo.html @@ -0,0 +1,624 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.PolicyQualifierInfo + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.PolicyQualifierInfo +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + PolicyQualifierInfo ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    PolicyQualifierInfo ASN.1 structure class +This class represents + +PolicyQualifierInfo defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.PolicyQualifierInfo(params) +
    + +
    + PolicyQualifierInfo ASN.1 structure class +This class represents + +PolicyQualifierInfo defined in RFC 5280 4.2.1.4. +
    +PolicyQualifierInfo ::= SEQUENCE {
    +     policyQualifierId  PolicyQualifierId,
    +     qualifier          ANY DEFINED BY policyQualifierId }
    +PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    +CPSuri ::= IA5String
    +
    +Its constructor can have one of following two parameters: + + +
    + + + +
    new PolicyQualifierInfo({
    +  cps: "https://example.com/repository/cps"
    +})
    +
    +new PolicyQualifierInfo({
    +  unotice: {
    +    noticeref: { // CA SHOULD NOT use this by RFC
    +      org: {type: "bmp", str: "Sample Org"},
    +      noticenum: [{int: 3}, {hex: "01af"}]
    +    },
    +    exptext: {type: "ia5", str: "Sample Policy"}
    +  }
    +})
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.RDN.html b/api/symbols/KJUR.asn1.x509.RDN.html index 2ee699a3..58522dc9 100644 --- a/api/symbols/KJUR.asn1.x509.RDN.html +++ b/api/symbols/KJUR.asn1.x509.RDN.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectAltName.html b/api/symbols/KJUR.asn1.x509.SubjectAltName.html index 89923997..e97d57ed 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectAltName.html +++ b/api/symbols/KJUR.asn1.x509.SubjectAltName.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html index 642efec9..865164c5 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html index a2c0d4f3..736a30b5 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html +++ b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertList.html b/api/symbols/KJUR.asn1.x509.TBSCertList.html index 3074d224..4ab09162 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertList.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertList.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertificate.html b/api/symbols/KJUR.asn1.x509.TBSCertificate.html index 5a9ec058..84a1b75e 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertificate.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertificate.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -751,12 +767,14 @@

    EXAMPLE

  • BasicConstraints - KJUR.asn1.x509.BasicConstraints
  • KeyUsage - KJUR.asn1.x509.KeyUsage
  • CRLDistributionPoints - KJUR.asn1.x509.CRLDistributionPoints
  • +
  • CertificatePolicies - KJUR.asn1.x509.CertificatePolicies
  • ExtKeyUsage - KJUR.asn1.x509.ExtKeyUsage
  • AuthorityKeyIdentifier - KJUR.asn1.x509.AuthorityKeyIdentifier
  • SubjectKeyIdentifier - KJUR.asn1.x509.SubjectKeyIdentifier
  • AuthorityInfoAccess - KJUR.asn1.x509.AuthorityInfoAccess
  • SubjectAltName - KJUR.asn1.x509.SubjectAltName
  • IssuerAltName - KJUR.asn1.x509.IssuerAltName
  • +
  • CertificatePolicies - KJUR.asn1.x509.CertificatePolicies
  • diff --git a/api/symbols/KJUR.asn1.x509.Time.html b/api/symbols/KJUR.asn1.x509.Time.html index bb50405d..1a1eaf40 100644 --- a/api/symbols/KJUR.asn1.x509.Time.html +++ b/api/symbols/KJUR.asn1.x509.Time.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.UserNotice.html b/api/symbols/KJUR.asn1.x509.UserNotice.html new file mode 100644 index 00000000..960870e0 --- /dev/null +++ b/api/symbols/KJUR.asn1.x509.UserNotice.html @@ -0,0 +1,618 @@ + + + + + + + jsrsasign JavaScript API Reference - KJUR.asn1.x509.UserNotice + + + + + + + + + + + + +
    + + +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.x509.UserNotice +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + UserNotice ASN.1 structure class + + +
    Defined in: asn1x509-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    UserNotice ASN.1 structure class +This class represents + +UserNotice defined in RFC 5280 4.2.1.4.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + +
    +
    Methods borrowed from class KJUR.asn1.ASN1Object:
    getEncodedHex, getLengthHexFromValue, getValueHex
    +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.x509.UserNotice(params) +
    + +
    + UserNotice ASN.1 structure class +This class represents + +UserNotice defined in RFC 5280 4.2.1.4. +
    +UserNotice ::= SEQUENCE {
    +     noticeRef        NoticeReference OPTIONAL,
    +     explicitText     DisplayText OPTIONAL }
    +
    +Its constructor can have following two parameters: + + +
    + + + +
    new UserNotice({
    +  noticeref: {
    +    org: {type: "bmp", str: "Sample Org"},
    +    noticenum: [{int: 3}, {hex: "01af"}]
    +  },
    +  exptext: {type: "ia5", str: "Sample Policy"}
    +})
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 8.0.23 asn1x509 1.1.12
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2020 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.x509.X500Name.html b/api/symbols/KJUR.asn1.x509.X500Name.html index f6573d0e..d2b06998 100644 --- a/api/symbols/KJUR.asn1.x509.X500Name.html +++ b/api/symbols/KJUR.asn1.x509.X500Name.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.X509Util.html b/api/symbols/KJUR.asn1.x509.X509Util.html index 5c486c4e..ea560e64 100644 --- a/api/symbols/KJUR.asn1.x509.X509Util.html +++ b/api/symbols/KJUR.asn1.x509.X509Util.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.asn1.x509.html b/api/symbols/KJUR.asn1.x509.html index 7b425dd8..597a34f6 100644 --- a/api/symbols/KJUR.asn1.x509.html +++ b/api/symbols/KJUR.asn1.x509.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • @@ -633,16 +649,20 @@

    SUPPORTED EXTENSIONS

  • KJUR.asn1.x509.BasicConstraints
  • KJUR.asn1.x509.KeyUsage
  • KJUR.asn1.x509.CRLDistributionPoints
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • KJUR.asn1.x509.ExtKeyUsage
  • KJUR.asn1.x509.AuthorityKeyIdentifier
  • KJUR.asn1.x509.SubjectKeyIdentifier
  • KJUR.asn1.x509.AuthorityInfoAccess
  • KJUR.asn1.x509.SubjectAltName
  • KJUR.asn1.x509.IssuerAltName
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • NOTE1: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
    -NOTE2: SubjectAltName and IssuerAltName extension were supported since +NOTE2: SubjectAltName and IssuerAltName supported since jsrsasign 6.2.3 asn1x509 1.0.19.
    +NOTE3: CeritifcatePolicies supported supported since +jsrsasign 8.0.23 asn1x509 1.1.12
    diff --git a/api/symbols/KJUR.crypto.Cipher.html b/api/symbols/KJUR.crypto.Cipher.html index dc1aca5d..d5a96d99 100644 --- a/api/symbols/KJUR.crypto.Cipher.html +++ b/api/symbols/KJUR.crypto.Cipher.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.DSA.html b/api/symbols/KJUR.crypto.DSA.html index 839e9dfb..aa971449 100644 --- a/api/symbols/KJUR.crypto.DSA.html +++ b/api/symbols/KJUR.crypto.DSA.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.ECDSA.html b/api/symbols/KJUR.crypto.ECDSA.html index 9dbb9725..07a70afa 100644 --- a/api/symbols/KJUR.crypto.ECDSA.html +++ b/api/symbols/KJUR.crypto.ECDSA.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.ECParameterDB.html b/api/symbols/KJUR.crypto.ECParameterDB.html index a5a21345..ef410ff4 100644 --- a/api/symbols/KJUR.crypto.ECParameterDB.html +++ b/api/symbols/KJUR.crypto.ECParameterDB.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.Mac.html b/api/symbols/KJUR.crypto.Mac.html index 869b0b7a..9ffb497a 100644 --- a/api/symbols/KJUR.crypto.Mac.html +++ b/api/symbols/KJUR.crypto.Mac.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.MessageDigest.html b/api/symbols/KJUR.crypto.MessageDigest.html index 65e1ac4e..586f71bf 100644 --- a/api/symbols/KJUR.crypto.MessageDigest.html +++ b/api/symbols/KJUR.crypto.MessageDigest.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.OID.html b/api/symbols/KJUR.crypto.OID.html index 44f203c0..d2aebaac 100644 --- a/api/symbols/KJUR.crypto.OID.html +++ b/api/symbols/KJUR.crypto.OID.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.Signature.html b/api/symbols/KJUR.crypto.Signature.html index 19ce8209..520aadfb 100644 --- a/api/symbols/KJUR.crypto.Signature.html +++ b/api/symbols/KJUR.crypto.Signature.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.Util.html b/api/symbols/KJUR.crypto.Util.html index 65742a7b..74363341 100644 --- a/api/symbols/KJUR.crypto.Util.html +++ b/api/symbols/KJUR.crypto.Util.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.crypto.html b/api/symbols/KJUR.crypto.html index dd3ded0e..5da197bc 100644 --- a/api/symbols/KJUR.crypto.html +++ b/api/symbols/KJUR.crypto.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.html b/api/symbols/KJUR.html index 7c626653..1efbe2d4 100644 --- a/api/symbols/KJUR.html +++ b/api/symbols/KJUR.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.jws.IntDate.html b/api/symbols/KJUR.jws.IntDate.html index 84eb3cb4..d3fdb6b6 100644 --- a/api/symbols/KJUR.jws.IntDate.html +++ b/api/symbols/KJUR.jws.IntDate.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.jws.JWS.html b/api/symbols/KJUR.jws.JWS.html index fa64ad57..bba34d5f 100644 --- a/api/symbols/KJUR.jws.JWS.html +++ b/api/symbols/KJUR.jws.JWS.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.jws.JWSJS.html b/api/symbols/KJUR.jws.JWSJS.html index a4797201..f3958cf0 100644 --- a/api/symbols/KJUR.jws.JWSJS.html +++ b/api/symbols/KJUR.jws.JWSJS.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.jws.html b/api/symbols/KJUR.jws.html index 4646c27a..038c8772 100644 --- a/api/symbols/KJUR.jws.html +++ b/api/symbols/KJUR.jws.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/KJUR.lang.String.html b/api/symbols/KJUR.lang.String.html index dd49dfb7..8485df44 100644 --- a/api/symbols/KJUR.lang.String.html +++ b/api/symbols/KJUR.lang.String.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/RSAKey.html b/api/symbols/RSAKey.html index df42ee1f..d0760ab3 100644 --- a/api/symbols/RSAKey.html +++ b/api/symbols/RSAKey.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/X509.html b/api/symbols/X509.html index 12791f16..69f04b57 100644 --- a/api/symbols/X509.html +++ b/api/symbols/X509.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/global__.html b/api/symbols/global__.html index 2e245d8d..1fb37f15 100644 --- a/api/symbols/global__.html +++ b/api/symbols/global__.html @@ -267,6 +267,8 @@

    Classes

  • KJUR.asn1.DERBitString
  • +
  • KJUR.asn1.DERBMPString
  • +
  • KJUR.asn1.DERBoolean
  • KJUR.asn1.DEREnumerated
  • @@ -299,6 +301,8 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.DERVisibleString
  • +
  • KJUR.asn1.ocsp
  • KJUR.asn1.ocsp.CertID
  • @@ -353,12 +357,16 @@

    Classes

  • KJUR.asn1.x509.Certificate
  • +
  • KJUR.asn1.x509.CertificatePolicies
  • +
  • KJUR.asn1.x509.CRL
  • KJUR.asn1.x509.CRLDistributionPoints
  • KJUR.asn1.x509.CRLEntry
  • +
  • KJUR.asn1.x509.DisplayText
  • +
  • KJUR.asn1.x509.DistributionPoint
  • KJUR.asn1.x509.DistributionPointName
  • @@ -375,8 +383,14 @@

    Classes

  • KJUR.asn1.x509.KeyUsage
  • +
  • KJUR.asn1.x509.NoticeReference
  • +
  • KJUR.asn1.x509.OID
  • +
  • KJUR.asn1.x509.PolicyInformation
  • + +
  • KJUR.asn1.x509.PolicyQualifierInfo
  • +
  • KJUR.asn1.x509.RDN
  • KJUR.asn1.x509.SubjectAltName
  • @@ -391,6 +405,8 @@

    Classes

  • KJUR.asn1.x509.Time
  • +
  • KJUR.asn1.x509.UserNotice
  • +
  • KJUR.asn1.x509.X500Name
  • KJUR.asn1.x509.X509Util
  • diff --git a/api/symbols/src/asn1-1.0.js.html b/api/symbols/src/asn1-1.0.js.html index ad754cdd..231c934f 100644 --- a/api/symbols/src/asn1-1.0.js.html +++ b/api/symbols/src/asn1-1.0.js.html @@ -5,12 +5,12 @@ .STRN {color: #393;} .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;} -
      1 /* asn1-1.0.14.js (c) 2013-2018 Kenji Urushima | kjur.github.com/jsrsasign/license
    +	
      1 /* asn1-1.0.15.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
       2  */
       3 /*
       4  * asn1.js - ASN.1 DER encoder classes
       5  *
    -  6  * Copyright (c) 2013-2018 Kenji Urushima (kenji.urushima@gmail.com)
    +  6  * Copyright (c) 2013-2020 Kenji Urushima (kenji.urushima@gmail.com)
       7  *
       8  * This software is licensed under the terms of the MIT License.
       9  * https://kjur.github.io/jsrsasign/license
    @@ -23,7 +23,7 @@
      16  * @fileOverview
      17  * @name asn1-1.0.js
      18  * @author Kenji Urushima kenji.urushima@gmail.com
    - 19  * @version asn1 1.0.14 (2018-Apr-03)
    + 19  * @version asn1 1.0.15 (2020-Aug-05)
      20  * @since jsrsasign 2.1
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -69,1600 +69,1642 @@
      62  * <li>0x16 {@link KJUR.asn1.DERIA5String}</li>
      63  * <li>0x17 {@link KJUR.asn1.DERUTCTime}</li>
      64  * <li>0x18 {@link KJUR.asn1.DERGeneralizedTime}</li>
    - 65  * <li>0x30 {@link KJUR.asn1.DERSequence}</li>
    - 66  * <li>0x31 {@link KJUR.asn1.DERSet}</li>
    - 67  * </ul>
    - 68  * <h4>OTHER ASN.1 CLASSES</h4>
    - 69  * <ul>
    - 70  * <li>{@link KJUR.asn1.ASN1Object}</li>
    - 71  * <li>{@link KJUR.asn1.DERAbstractString}</li>
    - 72  * <li>{@link KJUR.asn1.DERAbstractTime}</li>
    - 73  * <li>{@link KJUR.asn1.DERAbstractStructured}</li>
    - 74  * <li>{@link KJUR.asn1.DERTaggedObject}</li>
    - 75  * </ul>
    - 76  * <h4>SUB NAME SPACES</h4>
    - 77  * <ul>
    - 78  * <li>{@link KJUR.asn1.cades} - CAdES long term signature format</li>
    - 79  * <li>{@link KJUR.asn1.cms} - Cryptographic Message Syntax</li>
    - 80  * <li>{@link KJUR.asn1.csr} - Certificate Signing Request (CSR/PKCS#10)</li>
    - 81  * <li>{@link KJUR.asn1.tsp} - RFC 3161 Timestamping Protocol Format</li>
    - 82  * <li>{@link KJUR.asn1.x509} - RFC 5280 X.509 certificate and CRL</li>
    - 83  * </ul>
    - 84  * </p>
    - 85  * NOTE: Please ignore method summary and document of this namespace. 
    - 86  * This caused by a bug of jsdoc2.
    - 87  * @name KJUR.asn1
    - 88  * @namespace
    - 89  */
    - 90 if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {};
    - 91 
    - 92 /**
    - 93  * ASN1 utilities class
    - 94  * @name KJUR.asn1.ASN1Util
    - 95  * @class ASN1 utilities class
    - 96  * @since asn1 1.0.2
    - 97  */
    - 98 KJUR.asn1.ASN1Util = new function() {
    - 99     this.integerToByteHex = function(i) {
    -100         var h = i.toString(16);
    -101         if ((h.length % 2) == 1) h = '0' + h;
    -102         return h;
    -103     };
    -104     this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {
    -105         var h = bigIntegerValue.toString(16);
    -106         if (h.substr(0, 1) != '-') {
    -107             if (h.length % 2 == 1) {
    -108                 h = '0' + h;
    -109             } else {
    -110                 if (! h.match(/^[0-7]/)) {
    -111                     h = '00' + h;
    -112                 }
    -113             }
    -114         } else {
    -115             var hPos = h.substr(1);
    -116             var xorLen = hPos.length;
    -117             if (xorLen % 2 == 1) {
    -118                 xorLen += 1;
    -119             } else {
    -120                 if (! h.match(/^[0-7]/)) {
    -121                     xorLen += 2;
    -122                 }
    -123             }
    -124             var hMask = '';
    -125             for (var i = 0; i < xorLen; i++) {
    -126                 hMask += 'f';
    -127             }
    -128             var biMask = new BigInteger(hMask, 16);
    -129             var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);
    -130             h = biNeg.toString(16).replace(/^-/, '');
    -131         }
    -132         return h;
    -133     };
    -134     /**
    -135      * get PEM string from hexadecimal data and header string
    -136      * @name getPEMStringFromHex
    -137      * @memberOf KJUR.asn1.ASN1Util
    -138      * @function
    -139      * @param {String} dataHex hexadecimal string of PEM body
    -140      * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')
    -141      * @return {String} PEM formatted string of input data
    -142      * @description
    -143      * This method converts a hexadecimal string to a PEM string with
    -144      * a specified header. Its line break will be CRLF("\r\n").
    -145      * @example
    -146      * var pem  = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');
    -147      * // value of pem will be:
    -148      * -----BEGIN PRIVATE KEY-----
    -149      * YWFh
    -150      * -----END PRIVATE KEY-----
    -151      */
    -152     this.getPEMStringFromHex = function(dataHex, pemHeader) {
    -153 	return hextopem(dataHex, pemHeader);
    -154     };
    -155 
    -156     /**
    -157      * generate ASN1Object specifed by JSON parameters
    -158      * @name newObject
    -159      * @memberOf KJUR.asn1.ASN1Util
    -160      * @function
    -161      * @param {Array} param JSON parameter to generate ASN1Object
    -162      * @return {KJUR.asn1.ASN1Object} generated object
    -163      * @since asn1 1.0.3
    -164      * @description
    -165      * generate any ASN1Object specified by JSON param
    -166      * including ASN.1 primitive or structured.
    -167      * Generally 'param' can be described as follows:
    -168      * <blockquote>
    -169      * {TYPE-OF-ASNOBJ: ASN1OBJ-PARAMETER}
    -170      * </blockquote>
    -171      * 'TYPE-OF-ASN1OBJ' can be one of following symbols:
    -172      * <ul>
    -173      * <li>'bool' - DERBoolean</li>
    -174      * <li>'int' - DERInteger</li>
    -175      * <li>'bitstr' - DERBitString</li>
    -176      * <li>'octstr' - DEROctetString</li>
    -177      * <li>'null' - DERNull</li>
    -178      * <li>'oid' - DERObjectIdentifier</li>
    -179      * <li>'enum' - DEREnumerated</li>
    -180      * <li>'utf8str' - DERUTF8String</li>
    -181      * <li>'numstr' - DERNumericString</li>
    -182      * <li>'prnstr' - DERPrintableString</li>
    -183      * <li>'telstr' - DERTeletexString</li>
    -184      * <li>'ia5str' - DERIA5String</li>
    -185      * <li>'utctime' - DERUTCTime</li>
    -186      * <li>'gentime' - DERGeneralizedTime</li>
    -187      * <li>'seq' - DERSequence</li>
    -188      * <li>'set' - DERSet</li>
    -189      * <li>'tag' - DERTaggedObject</li>
    -190      * </ul>
    -191      * @example
    -192      * newObject({'prnstr': 'aaa'});
    -193      * newObject({'seq': [{'int': 3}, {'prnstr': 'aaa'}]})
    -194      * // ASN.1 Tagged Object
    -195      * newObject({'tag': {'tag': 'a1', 
    -196      *                    'explicit': true,
    -197      *                    'obj': {'seq': [{'int': 3}, {'prnstr': 'aaa'}]}}});
    -198      * // more simple representation of ASN.1 Tagged Object
    -199      * newObject({'tag': ['a1',
    -200      *                    true,
    -201      *                    {'seq': [
    -202      *                      {'int': 3}, 
    -203      *                      {'prnstr': 'aaa'}]}
    -204      *                   ]});
    -205      */
    -206     this.newObject = function(param) {
    -207 	var _KJUR = KJUR,
    -208 	    _KJUR_asn1 = _KJUR.asn1,
    -209 	    _DERBoolean = _KJUR_asn1.DERBoolean,
    -210 	    _DERInteger = _KJUR_asn1.DERInteger,
    -211 	    _DERBitString = _KJUR_asn1.DERBitString,
    -212 	    _DEROctetString = _KJUR_asn1.DEROctetString,
    -213 	    _DERNull = _KJUR_asn1.DERNull,
    -214 	    _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -215 	    _DEREnumerated = _KJUR_asn1.DEREnumerated,
    -216 	    _DERUTF8String = _KJUR_asn1.DERUTF8String,
    -217 	    _DERNumericString = _KJUR_asn1.DERNumericString,
    -218 	    _DERPrintableString = _KJUR_asn1.DERPrintableString,
    -219 	    _DERTeletexString = _KJUR_asn1.DERTeletexString,
    -220 	    _DERIA5String = _KJUR_asn1.DERIA5String,
    -221 	    _DERUTCTime = _KJUR_asn1.DERUTCTime,
    -222 	    _DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime,
    -223 	    _DERSequence = _KJUR_asn1.DERSequence,
    -224 	    _DERSet = _KJUR_asn1.DERSet,
    -225 	    _DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -226 	    _newObject = _KJUR_asn1.ASN1Util.newObject;
    -227 
    -228         var keys = Object.keys(param);
    -229         if (keys.length != 1)
    -230             throw "key of param shall be only one.";
    -231         var key = keys[0];
    -232 
    -233         if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + key + ":") == -1)
    -234             throw "undefined key: " + key;
    -235 
    -236         if (key == "bool")    return new _DERBoolean(param[key]);
    -237         if (key == "int")     return new _DERInteger(param[key]);
    -238         if (key == "bitstr")  return new _DERBitString(param[key]);
    -239         if (key == "octstr")  return new _DEROctetString(param[key]);
    -240         if (key == "null")    return new _DERNull(param[key]);
    -241         if (key == "oid")     return new _DERObjectIdentifier(param[key]);
    -242         if (key == "enum")    return new _DEREnumerated(param[key]);
    -243         if (key == "utf8str") return new _DERUTF8String(param[key]);
    -244         if (key == "numstr")  return new _DERNumericString(param[key]);
    -245         if (key == "prnstr")  return new _DERPrintableString(param[key]);
    -246         if (key == "telstr")  return new _DERTeletexString(param[key]);
    -247         if (key == "ia5str")  return new _DERIA5String(param[key]);
    -248         if (key == "utctime") return new _DERUTCTime(param[key]);
    -249         if (key == "gentime") return new _DERGeneralizedTime(param[key]);
    -250 
    -251         if (key == "seq") {
    -252             var paramList = param[key];
    -253             var a = [];
    -254             for (var i = 0; i < paramList.length; i++) {
    -255                 var asn1Obj = _newObject(paramList[i]);
    -256                 a.push(asn1Obj);
    -257             }
    -258             return new _DERSequence({'array': a});
    -259         }
    -260 
    -261         if (key == "set") {
    -262             var paramList = param[key];
    -263             var a = [];
    -264             for (var i = 0; i < paramList.length; i++) {
    -265                 var asn1Obj = _newObject(paramList[i]);
    -266                 a.push(asn1Obj);
    -267             }
    -268             return new _DERSet({'array': a});
    -269         }
    -270 
    -271         if (key == "tag") {
    -272             var tagParam = param[key];
    -273             if (Object.prototype.toString.call(tagParam) === '[object Array]' &&
    -274                 tagParam.length == 3) {
    -275                 var obj = _newObject(tagParam[2]);
    -276                 return new _DERTaggedObject({tag: tagParam[0],
    -277 					     explicit: tagParam[1],
    -278 					     obj: obj});
    -279             } else {
    -280                 var newParam = {};
    -281                 if (tagParam.explicit !== undefined)
    -282                     newParam.explicit = tagParam.explicit;
    -283                 if (tagParam.tag !== undefined)
    -284                     newParam.tag = tagParam.tag;
    -285                 if (tagParam.obj === undefined)
    -286                     throw "obj shall be specified for 'tag'.";
    -287                 newParam.obj = _newObject(tagParam.obj);
    -288                 return new _DERTaggedObject(newParam);
    -289             }
    -290         }
    -291     };
    -292 
    -293     /**
    -294      * get encoded hexadecimal string of ASN1Object specifed by JSON parameters
    -295      * @name jsonToASN1HEX
    -296      * @memberOf KJUR.asn1.ASN1Util
    -297      * @function
    -298      * @param {Array} param JSON parameter to generate ASN1Object
    -299      * @return hexadecimal string of ASN1Object
    -300      * @since asn1 1.0.4
    -301      * @description
    -302      * As for ASN.1 object representation of JSON object,
    -303      * please see {@link newObject}.
    -304      * @example
    -305      * jsonToASN1HEX({'prnstr': 'aaa'}); 
    -306      */
    -307     this.jsonToASN1HEX = function(param) {
    -308         var asn1Obj = this.newObject(param);
    -309         return asn1Obj.getEncodedHex();
    -310     };
    -311 };
    -312 
    -313 /**
    -314  * get dot noted oid number string from hexadecimal value of OID
    -315  * @name oidHexToInt
    -316  * @memberOf KJUR.asn1.ASN1Util
    -317  * @function
    -318  * @param {String} hex hexadecimal value of object identifier
    -319  * @return {String} dot noted string of object identifier
    -320  * @since jsrsasign 4.8.3 asn1 1.0.7
    -321  * @description
    -322  * This static method converts from hexadecimal string representation of 
    -323  * ASN.1 value of object identifier to oid number string.
    -324  * @example
    -325  * KJUR.asn1.ASN1Util.oidHexToInt('550406') → "2.5.4.6"
    -326  */
    -327 KJUR.asn1.ASN1Util.oidHexToInt = function(hex) {
    -328     var s = "";
    -329     var i01 = parseInt(hex.substr(0, 2), 16);
    -330     var i0 = Math.floor(i01 / 40);
    -331     var i1 = i01 % 40;
    -332     var s = i0 + "." + i1;
    -333 
    -334     var binbuf = "";
    -335     for (var i = 2; i < hex.length; i += 2) {
    -336 	var value = parseInt(hex.substr(i, 2), 16);
    -337         var bin = ("00000000" + value.toString(2)).slice(- 8);
    -338 	binbuf = binbuf + bin.substr(1, 7);
    -339 	if (bin.substr(0, 1) == "0") {
    -340 	    var bi = new BigInteger(binbuf, 2);
    -341 	    s = s + "." + bi.toString(10);
    -342 	    binbuf = "";
    -343 	}
    -344     };
    -345 
    -346     return s;
    -347 };
    -348 
    -349 /**
    -350  * get hexadecimal value of object identifier from dot noted oid value
    -351  * @name oidIntToHex
    -352  * @memberOf KJUR.asn1.ASN1Util
    -353  * @function
    -354  * @param {String} oidString dot noted string of object identifier
    -355  * @return {String} hexadecimal value of object identifier
    -356  * @since jsrsasign 4.8.3 asn1 1.0.7
    -357  * @see {@link ASN1HEX.hextooidstr}
    -358  * @description
    -359  * This static method converts from object identifier value string.
    -360  * to hexadecimal string representation of it.
    -361  * {@link ASN1HEX.hextooidstr} is a reverse function of this.
    -362  * @example
    -363  * KJUR.asn1.ASN1Util.oidIntToHex("2.5.4.6") → "550406"
    -364  */
    -365 KJUR.asn1.ASN1Util.oidIntToHex = function(oidString) {
    -366     var itox = function(i) {
    -367         var h = i.toString(16);
    -368         if (h.length == 1) h = '0' + h;
    -369         return h;
    -370     };
    -371 
    -372     var roidtox = function(roid) {
    -373         var h = '';
    -374         var bi = new BigInteger(roid, 10);
    -375         var b = bi.toString(2);
    -376         var padLen = 7 - b.length % 7;
    -377         if (padLen == 7) padLen = 0;
    -378         var bPad = '';
    -379         for (var i = 0; i < padLen; i++) bPad += '0';
    -380         b = bPad + b;
    -381         for (var i = 0; i < b.length - 1; i += 7) {
    -382             var b8 = b.substr(i, 7);
    -383             if (i != b.length - 7) b8 = '1' + b8;
    -384             h += itox(parseInt(b8, 2));
    -385         }
    -386         return h;
    -387     };
    -388     
    -389     if (! oidString.match(/^[0-9.]+$/)) {
    -390         throw "malformed oid string: " + oidString;
    -391     }
    -392     var h = '';
    -393     var a = oidString.split('.');
    -394     var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
    -395     h += itox(i0);
    -396     a.splice(0, 2);
    -397     for (var i = 0; i < a.length; i++) {
    -398         h += roidtox(a[i]);
    + 65  * <li>0x1a {@link KJUR.asn1.DERVisibleString}</li>
    + 66  * <li>0x1e {@link KJUR.asn1.DERBMPString}</li>
    + 67  * <li>0x30 {@link KJUR.asn1.DERSequence}</li>
    + 68  * <li>0x31 {@link KJUR.asn1.DERSet}</li>
    + 69  * </ul>
    + 70  * <h4>OTHER ASN.1 CLASSES</h4>
    + 71  * <ul>
    + 72  * <li>{@link KJUR.asn1.ASN1Object}</li>
    + 73  * <li>{@link KJUR.asn1.DERAbstractString}</li>
    + 74  * <li>{@link KJUR.asn1.DERAbstractTime}</li>
    + 75  * <li>{@link KJUR.asn1.DERAbstractStructured}</li>
    + 76  * <li>{@link KJUR.asn1.DERTaggedObject}</li>
    + 77  * </ul>
    + 78  * <h4>SUB NAME SPACES</h4>
    + 79  * <ul>
    + 80  * <li>{@link KJUR.asn1.cades} - CAdES long term signature format</li>
    + 81  * <li>{@link KJUR.asn1.cms} - Cryptographic Message Syntax</li>
    + 82  * <li>{@link KJUR.asn1.csr} - Certificate Signing Request (CSR/PKCS#10)</li>
    + 83  * <li>{@link KJUR.asn1.tsp} - RFC 3161 Timestamping Protocol Format</li>
    + 84  * <li>{@link KJUR.asn1.x509} - RFC 5280 X.509 certificate and CRL</li>
    + 85  * </ul>
    + 86  * </p>
    + 87  * NOTE: Please ignore method summary and document of this namespace. 
    + 88  * This caused by a bug of jsdoc2.
    + 89  * @name KJUR.asn1
    + 90  * @namespace
    + 91  */
    + 92 if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {};
    + 93 
    + 94 /**
    + 95  * ASN1 utilities class
    + 96  * @name KJUR.asn1.ASN1Util
    + 97  * @class ASN1 utilities class
    + 98  * @since asn1 1.0.2
    + 99  */
    +100 KJUR.asn1.ASN1Util = new function() {
    +101     this.integerToByteHex = function(i) {
    +102         var h = i.toString(16);
    +103         if ((h.length % 2) == 1) h = '0' + h;
    +104         return h;
    +105     };
    +106     this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {
    +107         var h = bigIntegerValue.toString(16);
    +108         if (h.substr(0, 1) != '-') {
    +109             if (h.length % 2 == 1) {
    +110                 h = '0' + h;
    +111             } else {
    +112                 if (! h.match(/^[0-7]/)) {
    +113                     h = '00' + h;
    +114                 }
    +115             }
    +116         } else {
    +117             var hPos = h.substr(1);
    +118             var xorLen = hPos.length;
    +119             if (xorLen % 2 == 1) {
    +120                 xorLen += 1;
    +121             } else {
    +122                 if (! h.match(/^[0-7]/)) {
    +123                     xorLen += 2;
    +124                 }
    +125             }
    +126             var hMask = '';
    +127             for (var i = 0; i < xorLen; i++) {
    +128                 hMask += 'f';
    +129             }
    +130             var biMask = new BigInteger(hMask, 16);
    +131             var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);
    +132             h = biNeg.toString(16).replace(/^-/, '');
    +133         }
    +134         return h;
    +135     };
    +136     /**
    +137      * get PEM string from hexadecimal data and header string
    +138      * @name getPEMStringFromHex
    +139      * @memberOf KJUR.asn1.ASN1Util
    +140      * @function
    +141      * @param {String} dataHex hexadecimal string of PEM body
    +142      * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')
    +143      * @return {String} PEM formatted string of input data
    +144      * @description
    +145      * This method converts a hexadecimal string to a PEM string with
    +146      * a specified header. Its line break will be CRLF("\r\n").
    +147      * @example
    +148      * var pem  = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');
    +149      * // value of pem will be:
    +150      * -----BEGIN PRIVATE KEY-----
    +151      * YWFh
    +152      * -----END PRIVATE KEY-----
    +153      */
    +154     this.getPEMStringFromHex = function(dataHex, pemHeader) {
    +155 	return hextopem(dataHex, pemHeader);
    +156     };
    +157 
    +158     /**
    +159      * generate ASN1Object specifed by JSON parameters
    +160      * @name newObject
    +161      * @memberOf KJUR.asn1.ASN1Util
    +162      * @function
    +163      * @param {Array} param JSON parameter to generate ASN1Object
    +164      * @return {KJUR.asn1.ASN1Object} generated object
    +165      * @since asn1 1.0.3
    +166      * @description
    +167      * generate any ASN1Object specified by JSON param
    +168      * including ASN.1 primitive or structured.
    +169      * Generally 'param' can be described as follows:
    +170      * <blockquote>
    +171      * {TYPE-OF-ASNOBJ: ASN1OBJ-PARAMETER}
    +172      * </blockquote>
    +173      * 'TYPE-OF-ASN1OBJ' can be one of following symbols:
    +174      * <ul>
    +175      * <li>'bool' - DERBoolean</li>
    +176      * <li>'int' - DERInteger</li>
    +177      * <li>'bitstr' - DERBitString</li>
    +178      * <li>'octstr' - DEROctetString</li>
    +179      * <li>'null' - DERNull</li>
    +180      * <li>'oid' - DERObjectIdentifier</li>
    +181      * <li>'enum' - DEREnumerated</li>
    +182      * <li>'utf8str' - DERUTF8String</li>
    +183      * <li>'numstr' - DERNumericString</li>
    +184      * <li>'prnstr' - DERPrintableString</li>
    +185      * <li>'telstr' - DERTeletexString</li>
    +186      * <li>'ia5str' - DERIA5String</li>
    +187      * <li>'utctime' - DERUTCTime</li>
    +188      * <li>'gentime' - DERGeneralizedTime</li>
    +189      * <li>'visstr' - DERVisibleString</li>
    +190      * <li>'bmpstr' - DERBMPString</li>
    +191      * <li>'seq' - DERSequence</li>
    +192      * <li>'set' - DERSet</li>
    +193      * <li>'tag' - DERTaggedObject</li>
    +194      * </ul>
    +195      * @example
    +196      * newObject({'prnstr': 'aaa'});
    +197      * newObject({'seq': [{'int': 3}, {'prnstr': 'aaa'}]})
    +198      * // ASN.1 Tagged Object
    +199      * newObject({'tag': {'tag': 'a1', 
    +200      *                    'explicit': true,
    +201      *                    'obj': {'seq': [{'int': 3}, {'prnstr': 'aaa'}]}}});
    +202      * // more simple representation of ASN.1 Tagged Object
    +203      * newObject({'tag': ['a1',
    +204      *                    true,
    +205      *                    {'seq': [
    +206      *                      {'int': 3}, 
    +207      *                      {'prnstr': 'aaa'}]}
    +208      *                   ]});
    +209      */
    +210     this.newObject = function(param) {
    +211 	var _KJUR = KJUR,
    +212 	    _KJUR_asn1 = _KJUR.asn1,
    +213 	    _DERBoolean = _KJUR_asn1.DERBoolean,
    +214 	    _DERInteger = _KJUR_asn1.DERInteger,
    +215 	    _DERBitString = _KJUR_asn1.DERBitString,
    +216 	    _DEROctetString = _KJUR_asn1.DEROctetString,
    +217 	    _DERNull = _KJUR_asn1.DERNull,
    +218 	    _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +219 	    _DEREnumerated = _KJUR_asn1.DEREnumerated,
    +220 	    _DERUTF8String = _KJUR_asn1.DERUTF8String,
    +221 	    _DERNumericString = _KJUR_asn1.DERNumericString,
    +222 	    _DERPrintableString = _KJUR_asn1.DERPrintableString,
    +223 	    _DERTeletexString = _KJUR_asn1.DERTeletexString,
    +224 	    _DERIA5String = _KJUR_asn1.DERIA5String,
    +225 	    _DERUTCTime = _KJUR_asn1.DERUTCTime,
    +226 	    _DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime,
    +227 	    _DERVisibleString = _KJUR_asn1.DERVisibleString,
    +228 	    _DERBMPString = _KJUR_asn1.DERBMPString,
    +229 	    _DERSequence = _KJUR_asn1.DERSequence,
    +230 	    _DERSet = _KJUR_asn1.DERSet,
    +231 	    _DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +232 	    _newObject = _KJUR_asn1.ASN1Util.newObject;
    +233 
    +234         var keys = Object.keys(param);
    +235         if (keys.length != 1)
    +236             throw "key of param shall be only one.";
    +237         var key = keys[0];
    +238 
    +239         if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":" + key + ":") == -1)
    +240             throw new Error("undefined key: " + key);
    +241 
    +242         if (key == "bool")    return new _DERBoolean(param[key]);
    +243         if (key == "int")     return new _DERInteger(param[key]);
    +244         if (key == "bitstr")  return new _DERBitString(param[key]);
    +245         if (key == "octstr")  return new _DEROctetString(param[key]);
    +246         if (key == "null")    return new _DERNull(param[key]);
    +247         if (key == "oid")     return new _DERObjectIdentifier(param[key]);
    +248         if (key == "enum")    return new _DEREnumerated(param[key]);
    +249         if (key == "utf8str") return new _DERUTF8String(param[key]);
    +250         if (key == "numstr")  return new _DERNumericString(param[key]);
    +251         if (key == "prnstr")  return new _DERPrintableString(param[key]);
    +252         if (key == "telstr")  return new _DERTeletexString(param[key]);
    +253         if (key == "ia5str")  return new _DERIA5String(param[key]);
    +254         if (key == "utctime") return new _DERUTCTime(param[key]);
    +255         if (key == "gentime") return new _DERGeneralizedTime(param[key]);
    +256         if (key == "visstr")  return new _DERVisibleString(param[key]);
    +257         if (key == "bmpstr")  return new _DERBMPString(param[key]);
    +258 
    +259         if (key == "seq") {
    +260             var paramList = param[key];
    +261             var a = [];
    +262             for (var i = 0; i < paramList.length; i++) {
    +263                 var asn1Obj = _newObject(paramList[i]);
    +264                 a.push(asn1Obj);
    +265             }
    +266             return new _DERSequence({'array': a});
    +267         }
    +268 
    +269         if (key == "set") {
    +270             var paramList = param[key];
    +271             var a = [];
    +272             for (var i = 0; i < paramList.length; i++) {
    +273                 var asn1Obj = _newObject(paramList[i]);
    +274                 a.push(asn1Obj);
    +275             }
    +276             return new _DERSet({'array': a});
    +277         }
    +278 
    +279         if (key == "tag") {
    +280             var tagParam = param[key];
    +281             if (Object.prototype.toString.call(tagParam) === '[object Array]' &&
    +282                 tagParam.length == 3) {
    +283                 var obj = _newObject(tagParam[2]);
    +284                 return new _DERTaggedObject({tag: tagParam[0],
    +285 					     explicit: tagParam[1],
    +286 					     obj: obj});
    +287             } else {
    +288                 var newParam = {};
    +289                 if (tagParam.explicit !== undefined)
    +290                     newParam.explicit = tagParam.explicit;
    +291                 if (tagParam.tag !== undefined)
    +292                     newParam.tag = tagParam.tag;
    +293                 if (tagParam.obj === undefined)
    +294                     throw "obj shall be specified for 'tag'.";
    +295                 newParam.obj = _newObject(tagParam.obj);
    +296                 return new _DERTaggedObject(newParam);
    +297             }
    +298         }
    +299     };
    +300 
    +301     /**
    +302      * get encoded hexadecimal string of ASN1Object specifed by JSON parameters
    +303      * @name jsonToASN1HEX
    +304      * @memberOf KJUR.asn1.ASN1Util
    +305      * @function
    +306      * @param {Array} param JSON parameter to generate ASN1Object
    +307      * @return hexadecimal string of ASN1Object
    +308      * @since asn1 1.0.4
    +309      * @description
    +310      * As for ASN.1 object representation of JSON object,
    +311      * please see {@link newObject}.
    +312      * @example
    +313      * jsonToASN1HEX({'prnstr': 'aaa'}); 
    +314      */
    +315     this.jsonToASN1HEX = function(param) {
    +316         var asn1Obj = this.newObject(param);
    +317         return asn1Obj.getEncodedHex();
    +318     };
    +319 };
    +320 
    +321 /**
    +322  * get dot noted oid number string from hexadecimal value of OID
    +323  * @name oidHexToInt
    +324  * @memberOf KJUR.asn1.ASN1Util
    +325  * @function
    +326  * @param {String} hex hexadecimal value of object identifier
    +327  * @return {String} dot noted string of object identifier
    +328  * @since jsrsasign 4.8.3 asn1 1.0.7
    +329  * @description
    +330  * This static method converts from hexadecimal string representation of 
    +331  * ASN.1 value of object identifier to oid number string.
    +332  * @example
    +333  * KJUR.asn1.ASN1Util.oidHexToInt('550406') → "2.5.4.6"
    +334  */
    +335 KJUR.asn1.ASN1Util.oidHexToInt = function(hex) {
    +336     var s = "";
    +337     var i01 = parseInt(hex.substr(0, 2), 16);
    +338     var i0 = Math.floor(i01 / 40);
    +339     var i1 = i01 % 40;
    +340     var s = i0 + "." + i1;
    +341 
    +342     var binbuf = "";
    +343     for (var i = 2; i < hex.length; i += 2) {
    +344 	var value = parseInt(hex.substr(i, 2), 16);
    +345         var bin = ("00000000" + value.toString(2)).slice(- 8);
    +346 	binbuf = binbuf + bin.substr(1, 7);
    +347 	if (bin.substr(0, 1) == "0") {
    +348 	    var bi = new BigInteger(binbuf, 2);
    +349 	    s = s + "." + bi.toString(10);
    +350 	    binbuf = "";
    +351 	}
    +352     };
    +353 
    +354     return s;
    +355 };
    +356 
    +357 /**
    +358  * get hexadecimal value of object identifier from dot noted oid value
    +359  * @name oidIntToHex
    +360  * @memberOf KJUR.asn1.ASN1Util
    +361  * @function
    +362  * @param {String} oidString dot noted string of object identifier
    +363  * @return {String} hexadecimal value of object identifier
    +364  * @since jsrsasign 4.8.3 asn1 1.0.7
    +365  * @see {@link ASN1HEX.hextooidstr}
    +366  * @description
    +367  * This static method converts from object identifier value string.
    +368  * to hexadecimal string representation of it.
    +369  * {@link ASN1HEX.hextooidstr} is a reverse function of this.
    +370  * @example
    +371  * KJUR.asn1.ASN1Util.oidIntToHex("2.5.4.6") → "550406"
    +372  */
    +373 KJUR.asn1.ASN1Util.oidIntToHex = function(oidString) {
    +374     var itox = function(i) {
    +375         var h = i.toString(16);
    +376         if (h.length == 1) h = '0' + h;
    +377         return h;
    +378     };
    +379 
    +380     var roidtox = function(roid) {
    +381         var h = '';
    +382         var bi = new BigInteger(roid, 10);
    +383         var b = bi.toString(2);
    +384         var padLen = 7 - b.length % 7;
    +385         if (padLen == 7) padLen = 0;
    +386         var bPad = '';
    +387         for (var i = 0; i < padLen; i++) bPad += '0';
    +388         b = bPad + b;
    +389         for (var i = 0; i < b.length - 1; i += 7) {
    +390             var b8 = b.substr(i, 7);
    +391             if (i != b.length - 7) b8 = '1' + b8;
    +392             h += itox(parseInt(b8, 2));
    +393         }
    +394         return h;
    +395     };
    +396     
    +397     if (! oidString.match(/^[0-9.]+$/)) {
    +398         throw "malformed oid string: " + oidString;
     399     }
    -400     return h;
    -401 };
    -402 
    -403 
    -404 // ********************************************************************
    -405 //  Abstract ASN.1 Classes
    -406 // ********************************************************************
    -407 
    -408 // ********************************************************************
    -409 
    -410 /**
    -411  * base class for ASN.1 DER encoder object
    -412  * @name KJUR.asn1.ASN1Object
    -413  * @class base class for ASN.1 DER encoder object
    -414  * @property {Boolean} isModified flag whether internal data was changed
    -415  * @property {String} hTLV hexadecimal string of ASN.1 TLV
    -416  * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)
    -417  * @property {String} hL hexadecimal string of ASN.1 TLV length(L)
    -418  * @property {String} hV hexadecimal string of ASN.1 TLV value(V)
    -419  * @description
    -420  */
    -421 KJUR.asn1.ASN1Object = function() {
    -422     var isModified = true;
    -423     var hTLV = null;
    -424     var hT = '00';
    -425     var hL = '00';
    -426     var hV = '';
    -427 
    -428     /**
    -429      * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)
    -430      * @name getLengthHexFromValue
    -431      * @memberOf KJUR.asn1.ASN1Object#
    -432      * @function
    -433      * @return {String} hexadecimal string of ASN.1 TLV length(L)
    -434      */
    -435     this.getLengthHexFromValue = function() {
    -436         if (typeof this.hV == "undefined" || this.hV == null) {
    -437             throw "this.hV is null or undefined.";
    -438         }
    -439         if (this.hV.length % 2 == 1) {
    -440             throw "value hex must be even length: n=" + hV.length + ",v=" + this.hV;
    -441         }
    -442         var n = this.hV.length / 2;
    -443         var hN = n.toString(16);
    -444         if (hN.length % 2 == 1) {
    -445             hN = "0" + hN;
    +400     var h = '';
    +401     var a = oidString.split('.');
    +402     var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
    +403     h += itox(i0);
    +404     a.splice(0, 2);
    +405     for (var i = 0; i < a.length; i++) {
    +406         h += roidtox(a[i]);
    +407     }
    +408     return h;
    +409 };
    +410 
    +411 
    +412 // ********************************************************************
    +413 //  Abstract ASN.1 Classes
    +414 // ********************************************************************
    +415 
    +416 // ********************************************************************
    +417 
    +418 /**
    +419  * base class for ASN.1 DER encoder object
    +420  * @name KJUR.asn1.ASN1Object
    +421  * @class base class for ASN.1 DER encoder object
    +422  * @property {Boolean} isModified flag whether internal data was changed
    +423  * @property {String} hTLV hexadecimal string of ASN.1 TLV
    +424  * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)
    +425  * @property {String} hL hexadecimal string of ASN.1 TLV length(L)
    +426  * @property {String} hV hexadecimal string of ASN.1 TLV value(V)
    +427  * @description
    +428  */
    +429 KJUR.asn1.ASN1Object = function() {
    +430     var isModified = true;
    +431     var hTLV = null;
    +432     var hT = '00';
    +433     var hL = '00';
    +434     var hV = '';
    +435 
    +436     /**
    +437      * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)
    +438      * @name getLengthHexFromValue
    +439      * @memberOf KJUR.asn1.ASN1Object#
    +440      * @function
    +441      * @return {String} hexadecimal string of ASN.1 TLV length(L)
    +442      */
    +443     this.getLengthHexFromValue = function() {
    +444         if (typeof this.hV == "undefined" || this.hV == null) {
    +445             throw "this.hV is null or undefined.";
     446         }
    -447         if (n < 128) {
    -448             return hN;
    -449         } else {
    -450             var hNlen = hN.length / 2;
    -451             if (hNlen > 15) {
    -452                 throw "ASN.1 length too long to represent by 8x: n = " + n.toString(16);
    -453             }
    -454             var head = 128 + hNlen;
    -455             return head.toString(16) + hN;
    -456         }
    -457     };
    -458 
    -459     /**
    -460      * get hexadecimal string of ASN.1 TLV bytes
    -461      * @name getEncodedHex
    -462      * @memberOf KJUR.asn1.ASN1Object#
    -463      * @function
    -464      * @return {String} hexadecimal string of ASN.1 TLV
    -465      */
    -466     this.getEncodedHex = function() {
    -467         if (this.hTLV == null || this.isModified) {
    -468             this.hV = this.getFreshValueHex();
    -469             this.hL = this.getLengthHexFromValue();
    -470             this.hTLV = this.hT + this.hL + this.hV;
    -471             this.isModified = false;
    -472             //alert("first time: " + this.hTLV);
    -473         }
    -474         return this.hTLV;
    -475     };
    -476 
    -477     /**
    -478      * get hexadecimal string of ASN.1 TLV value(V) bytes
    -479      * @name getValueHex
    -480      * @memberOf KJUR.asn1.ASN1Object#
    -481      * @function
    -482      * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes
    -483      */
    -484     this.getValueHex = function() {
    -485         this.getEncodedHex();
    -486         return this.hV;
    -487     }
    -488 
    -489     this.getFreshValueHex = function() {
    -490         return '';
    -491     };
    -492 };
    -493 
    -494 // == BEGIN DERAbstractString ================================================
    -495 /**
    -496  * base class for ASN.1 DER string classes
    -497  * @name KJUR.asn1.DERAbstractString
    -498  * @class base class for ASN.1 DER string classes
    -499  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -500  * @property {String} s internal string of value
    -501  * @extends KJUR.asn1.ASN1Object
    -502  * @description
    -503  * <br/>
    -504  * As for argument 'params' for constructor, you can specify one of
    -505  * following properties:
    -506  * <ul>
    -507  * <li>str - specify initial ASN.1 value(V) by a string</li>
    -508  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -509  * </ul>
    -510  * NOTE: 'params' can be omitted.
    -511  */
    -512 KJUR.asn1.DERAbstractString = function(params) {
    -513     KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
    -514     var s = null;
    -515     var hV = null;
    -516 
    -517     /**
    -518      * get string value of this string object
    -519      * @name getString
    -520      * @memberOf KJUR.asn1.DERAbstractString#
    -521      * @function
    -522      * @return {String} string value of this string object
    -523      */
    -524     this.getString = function() {
    -525         return this.s;
    -526     };
    -527 
    -528     /**
    -529      * set value by a string
    -530      * @name setString
    -531      * @memberOf KJUR.asn1.DERAbstractString#
    -532      * @function
    -533      * @param {String} newS value by a string to set
    -534      * @description
    -535      * This method set value by string. <br/>
    -536      * NOTE: This method assumes that the argument string is
    -537      * UTF-8 encoded even though ASN.1 primitive 
    -538      * such as IA5String or PrintableString doesn't
    -539      * support all of UTF-8 characters.
    -540      * @example
    -541      * o = new KJUR.asn1.DERIA5String();
    -542      * o.setString("abc");
    -543      * o.setString("あいう");
    -544      */
    -545     this.setString = function(newS) {
    -546         this.hTLV = null;
    -547         this.isModified = true;
    -548         this.s = newS;
    -549         this.hV = utf8tohex(this.s).toLowerCase();
    -550     };
    -551 
    -552     /**
    -553      * set value by a hexadecimal string
    -554      * @name setStringHex
    -555      * @memberOf KJUR.asn1.DERAbstractString#
    -556      * @function
    -557      * @param {String} newHexString value by a hexadecimal string to set
    -558      */
    -559     this.setStringHex = function(newHexString) {
    -560         this.hTLV = null;
    -561         this.isModified = true;
    -562         this.s = null;
    -563         this.hV = newHexString;
    -564     };
    -565 
    -566     this.getFreshValueHex = function() {
    -567         return this.hV;
    -568     };
    -569 
    -570     if (typeof params != "undefined") {
    -571         if (typeof params == "string") {
    -572             this.setString(params);
    -573         } else if (typeof params['str'] != "undefined") {
    -574             this.setString(params['str']);
    -575         } else if (typeof params['hex'] != "undefined") {
    -576             this.setStringHex(params['hex']);
    -577         }
    -578     }
    -579 };
    -580 YAHOO.lang.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);
    -581 // == END   DERAbstractString ================================================
    -582 
    -583 // == BEGIN DERAbstractTime ==================================================
    -584 /**
    -585  * base class for ASN.1 DER Generalized/UTCTime class
    -586  * @name KJUR.asn1.DERAbstractTime
    -587  * @class base class for ASN.1 DER Generalized/UTCTime class
    -588  * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
    -589  * @extends KJUR.asn1.ASN1Object
    -590  * @description
    -591  * @see KJUR.asn1.ASN1Object - superclass
    -592  */
    -593 KJUR.asn1.DERAbstractTime = function(params) {
    -594     KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
    -595     var s = null;
    -596     var date = null;
    -597 
    -598     // --- PRIVATE METHODS --------------------
    -599     this.localDateToUTC = function(d) {
    -600         var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
    -601         var utcDate = new Date(utc);
    -602         return utcDate;
    -603     };
    -604 
    -605     /*
    -606      * format date string by Data object
    -607      * @name formatDate
    -608      * @memberOf KJUR.asn1.AbstractTime;
    -609      * @param {Date} dateObject 
    -610      * @param {string} type 'utc' or 'gen'
    -611      * @param {boolean} withMillis flag for with millisections or not
    -612      * @description
    -613      * 'withMillis' flag is supported from asn1 1.0.6.
    -614      */
    -615     this.formatDate = function(dateObject, type, withMillis) {
    -616         var pad = this.zeroPadding;
    -617         var d = this.localDateToUTC(dateObject);
    -618         var year = String(d.getFullYear());
    -619         if (type == 'utc') year = year.substr(2, 2);
    -620         var month = pad(String(d.getMonth() + 1), 2);
    -621         var day = pad(String(d.getDate()), 2);
    -622         var hour = pad(String(d.getHours()), 2);
    -623         var min = pad(String(d.getMinutes()), 2);
    -624         var sec = pad(String(d.getSeconds()), 2);
    -625         var s = year + month + day + hour + min + sec;
    -626         if (withMillis === true) {
    -627             var millis = d.getMilliseconds();
    -628             if (millis != 0) {
    -629                 var sMillis = pad(String(millis), 3);
    -630                 sMillis = sMillis.replace(/[0]+$/, "");
    -631                 s = s + "." + sMillis;
    -632             }
    -633         }
    -634         return s + "Z";
    -635     };
    -636 
    -637     this.zeroPadding = function(s, len) {
    -638         if (s.length >= len) return s;
    -639         return new Array(len - s.length + 1).join('0') + s;
    -640     };
    -641 
    -642     // --- PUBLIC METHODS --------------------
    -643     /**
    -644      * get string value of this string object
    -645      * @name getString
    -646      * @memberOf KJUR.asn1.DERAbstractTime#
    -647      * @function
    -648      * @return {String} string value of this time object
    -649      */
    -650     this.getString = function() {
    -651         return this.s;
    -652     };
    -653 
    -654     /**
    -655      * set value by a string
    -656      * @name setString
    -657      * @memberOf KJUR.asn1.DERAbstractTime#
    -658      * @function
    -659      * @param {String} newS value by a string to set such like "130430235959Z"
    -660      */
    -661     this.setString = function(newS) {
    -662         this.hTLV = null;
    -663         this.isModified = true;
    -664         this.s = newS;
    -665         this.hV = stohex(newS);
    -666     };
    -667 
    -668     /**
    -669      * set value by a Date object
    -670      * @name setByDateValue
    -671      * @memberOf KJUR.asn1.DERAbstractTime#
    -672      * @function
    -673      * @param {Integer} year year of date (ex. 2013)
    -674      * @param {Integer} month month of date between 1 and 12 (ex. 12)
    -675      * @param {Integer} day day of month
    -676      * @param {Integer} hour hours of date
    -677      * @param {Integer} min minutes of date
    -678      * @param {Integer} sec seconds of date
    -679      */
    -680     this.setByDateValue = function(year, month, day, hour, min, sec) {
    -681         var dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));
    -682         this.setByDate(dateObject);
    -683     };
    -684 
    -685     this.getFreshValueHex = function() {
    -686         return this.hV;
    -687     };
    -688 };
    -689 YAHOO.lang.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);
    -690 // == END   DERAbstractTime ==================================================
    -691 
    -692 // == BEGIN DERAbstractStructured ============================================
    -693 /**
    -694  * base class for ASN.1 DER structured class
    -695  * @name KJUR.asn1.DERAbstractStructured
    -696  * @class base class for ASN.1 DER structured class
    -697  * @property {Array} asn1Array internal array of ASN1Object
    -698  * @extends KJUR.asn1.ASN1Object
    -699  * @description
    -700  * @see KJUR.asn1.ASN1Object - superclass
    -701  */
    -702 KJUR.asn1.DERAbstractStructured = function(params) {
    -703     KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
    -704     var asn1Array = null;
    -705 
    -706     /**
    -707      * set value by array of ASN1Object
    -708      * @name setByASN1ObjectArray
    -709      * @memberOf KJUR.asn1.DERAbstractStructured#
    -710      * @function
    -711      * @param {array} asn1ObjectArray array of ASN1Object to set
    -712      */
    -713     this.setByASN1ObjectArray = function(asn1ObjectArray) {
    -714         this.hTLV = null;
    -715         this.isModified = true;
    -716         this.asn1Array = asn1ObjectArray;
    -717     };
    -718 
    -719     /**
    -720      * append an ASN1Object to internal array
    -721      * @name appendASN1Object
    -722      * @memberOf KJUR.asn1.DERAbstractStructured#
    -723      * @function
    -724      * @param {ASN1Object} asn1Object to add
    -725      */
    -726     this.appendASN1Object = function(asn1Object) {
    -727         this.hTLV = null;
    -728         this.isModified = true;
    -729         this.asn1Array.push(asn1Object);
    -730     };
    -731 
    -732     this.asn1Array = new Array();
    -733     if (typeof params != "undefined") {
    -734         if (typeof params['array'] != "undefined") {
    -735             this.asn1Array = params['array'];
    -736         }
    -737     }
    -738 };
    -739 YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);
    -740 
    -741 
    -742 // ********************************************************************
    -743 //  ASN.1 Object Classes
    -744 // ********************************************************************
    -745 
    -746 // ********************************************************************
    -747 /**
    -748  * class for ASN.1 DER Boolean
    -749  * @name KJUR.asn1.DERBoolean
    -750  * @class class for ASN.1 DER Boolean
    -751  * @extends KJUR.asn1.ASN1Object
    -752  * @description
    -753  * @see KJUR.asn1.ASN1Object - superclass
    -754  */
    -755 KJUR.asn1.DERBoolean = function() {
    -756     KJUR.asn1.DERBoolean.superclass.constructor.call(this);
    -757     this.hT = "01";
    -758     this.hTLV = "0101ff";
    -759 };
    -760 YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
    -761 
    -762 // ********************************************************************
    -763 /**
    -764  * class for ASN.1 DER Integer
    -765  * @name KJUR.asn1.DERInteger
    -766  * @class class for ASN.1 DER Integer
    -767  * @extends KJUR.asn1.ASN1Object
    -768  * @description
    -769  * <br/>
    -770  * As for argument 'params' for constructor, you can specify one of
    -771  * following properties:
    -772  * <ul>
    -773  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    -774  * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
    -775  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -776  * </ul>
    -777  * NOTE: 'params' can be omitted.
    -778  */
    -779 KJUR.asn1.DERInteger = function(params) {
    -780     KJUR.asn1.DERInteger.superclass.constructor.call(this);
    -781     this.hT = "02";
    -782 
    -783     /**
    -784      * set value by Tom Wu's BigInteger object
    -785      * @name setByBigInteger
    -786      * @memberOf KJUR.asn1.DERInteger#
    -787      * @function
    -788      * @param {BigInteger} bigIntegerValue to set
    -789      */
    -790     this.setByBigInteger = function(bigIntegerValue) {
    -791         this.hTLV = null;
    -792         this.isModified = true;
    -793         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    -794     };
    -795 
    -796     /**
    -797      * set value by integer value
    -798      * @name setByInteger
    -799      * @memberOf KJUR.asn1.DERInteger
    -800      * @function
    -801      * @param {Integer} integer value to set
    -802      */
    -803     this.setByInteger = function(intValue) {
    -804         var bi = new BigInteger(String(intValue), 10);
    -805         this.setByBigInteger(bi);
    -806     };
    -807 
    -808     /**
    -809      * set value by integer value
    -810      * @name setValueHex
    -811      * @memberOf KJUR.asn1.DERInteger#
    -812      * @function
    -813      * @param {String} hexadecimal string of integer value
    -814      * @description
    -815      * <br/>
    -816      * NOTE: Value shall be represented by minimum octet length of
    -817      * two's complement representation.
    -818      * @example
    -819      * new KJUR.asn1.DERInteger(123);
    -820      * new KJUR.asn1.DERInteger({'int': 123});
    -821      * new KJUR.asn1.DERInteger({'hex': '1fad'});
    -822      */
    -823     this.setValueHex = function(newHexString) {
    -824         this.hV = newHexString;
    -825     };
    -826 
    -827     this.getFreshValueHex = function() {
    -828         return this.hV;
    -829     };
    -830 
    -831     if (typeof params != "undefined") {
    -832         if (typeof params['bigint'] != "undefined") {
    -833             this.setByBigInteger(params['bigint']);
    -834         } else if (typeof params['int'] != "undefined") {
    -835             this.setByInteger(params['int']);
    -836         } else if (typeof params == "number") {
    -837             this.setByInteger(params);
    -838         } else if (typeof params['hex'] != "undefined") {
    -839             this.setValueHex(params['hex']);
    -840         }
    -841     }
    -842 };
    -843 YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
    -844 
    -845 // ********************************************************************
    -846 /**
    -847  * class for ASN.1 DER encoded BitString primitive
    -848  * @name KJUR.asn1.DERBitString
    -849  * @class class for ASN.1 DER encoded BitString primitive
    -850  * @extends KJUR.asn1.ASN1Object
    -851  * @description 
    -852  * <br/>
    -853  * As for argument 'params' for constructor, you can specify one of
    -854  * following properties:
    -855  * <ul>
    -856  * <li>bin - specify binary string (ex. '10111')</li>
    -857  * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
    -858  * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
    -859  * <li>obj - specify {@link KJUR.asn1.ASN1Util.newObject} 
    -860  * argument for "BitString encapsulates" structure.</li>
    -861  * </ul>
    -862  * NOTE1: 'params' can be omitted.<br/>
    -863  * NOTE2: 'obj' parameter have been supported since
    -864  * asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).<br/>
    -865  * @example
    -866  * // default constructor
    -867  * o = new KJUR.asn1.DERBitString();
    -868  * // initialize with binary string
    -869  * o = new KJUR.asn1.DERBitString({bin: "1011"});
    -870  * // initialize with boolean array
    -871  * o = new KJUR.asn1.DERBitString({array: [true,false,true,true]});
    -872  * // initialize with hexadecimal string (04 is unused bits)
    -873  * o = new KJUR.asn1.DEROctetString({hex: "04bac0"});
    -874  * // initialize with ASN1Util.newObject argument for encapsulated
    -875  * o = new KJUR.asn1.DERBitString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    -876  * // above generates a ASN.1 data like this:
    -877  * // BIT STRING, encapsulates {
    -878  * //   SEQUENCE {
    -879  * //     INTEGER 3
    -880  * //     PrintableString 'aaa'
    -881  * //     }
    -882  * //   } 
    -883  */
    -884 KJUR.asn1.DERBitString = function(params) {
    -885     if (params !== undefined && typeof params.obj !== "undefined") {
    -886 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    -887 	params.hex = "00" + o.getEncodedHex();
    -888     }
    -889     KJUR.asn1.DERBitString.superclass.constructor.call(this);
    -890     this.hT = "03";
    -891 
    -892     /**
    -893      * set ASN.1 value(V) by a hexadecimal string including unused bits
    -894      * @name setHexValueIncludingUnusedBits
    -895      * @memberOf KJUR.asn1.DERBitString#
    -896      * @function
    -897      * @param {String} newHexStringIncludingUnusedBits
    -898      */
    -899     this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
    -900         this.hTLV = null;
    -901         this.isModified = true;
    -902         this.hV = newHexStringIncludingUnusedBits;
    -903     };
    -904 
    -905     /**
    -906      * set ASN.1 value(V) by unused bit and hexadecimal string of value
    -907      * @name setUnusedBitsAndHexValue
    -908      * @memberOf KJUR.asn1.DERBitString#
    -909      * @function
    -910      * @param {Integer} unusedBits
    -911      * @param {String} hValue
    -912      */
    -913     this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
    -914         if (unusedBits < 0 || 7 < unusedBits) {
    -915             throw "unused bits shall be from 0 to 7: u = " + unusedBits;
    -916         }
    -917         var hUnusedBits = "0" + unusedBits;
    -918         this.hTLV = null;
    -919         this.isModified = true;
    -920         this.hV = hUnusedBits + hValue;
    -921     };
    -922 
    -923     /**
    -924      * set ASN.1 DER BitString by binary string<br/>
    -925      * @name setByBinaryString
    -926      * @memberOf KJUR.asn1.DERBitString#
    -927      * @function
    -928      * @param {String} binaryString binary value string (i.e. '10111')
    -929      * @description
    -930      * Its unused bits will be calculated automatically by length of 
    -931      * 'binaryValue'. <br/>
    -932      * NOTE: Trailing zeros '0' will be ignored.
    -933      * @example
    -934      * o = new KJUR.asn1.DERBitString();
    -935      * o.setByBooleanArray("01011");
    -936      */
    -937     this.setByBinaryString = function(binaryString) {
    -938         binaryString = binaryString.replace(/0+$/, '');
    -939         var unusedBits = 8 - binaryString.length % 8;
    -940         if (unusedBits == 8) unusedBits = 0;
    -941         for (var i = 0; i <= unusedBits; i++) {
    -942             binaryString += '0';
    -943         }
    -944         var h = '';
    -945         for (var i = 0; i < binaryString.length - 1; i += 8) {
    -946             var b = binaryString.substr(i, 8);
    -947             var x = parseInt(b, 2).toString(16);
    -948             if (x.length == 1) x = '0' + x;
    -949             h += x;  
    -950         }
    -951         this.hTLV = null;
    -952         this.isModified = true;
    -953         this.hV = '0' + unusedBits + h;
    -954     };
    -955 
    -956     /**
    -957      * set ASN.1 TLV value(V) by an array of boolean<br/>
    -958      * @name setByBooleanArray
    -959      * @memberOf KJUR.asn1.DERBitString#
    -960      * @function
    -961      * @param {array} booleanArray array of boolean (ex. [true, false, true])
    -962      * @description
    -963      * NOTE: Trailing falses will be ignored in the ASN.1 DER Object.
    -964      * @example
    -965      * o = new KJUR.asn1.DERBitString();
    -966      * o.setByBooleanArray([false, true, false, true, true]);
    -967      */
    -968     this.setByBooleanArray = function(booleanArray) {
    -969         var s = '';
    -970         for (var i = 0; i < booleanArray.length; i++) {
    -971             if (booleanArray[i] == true) {
    -972                 s += '1';
    -973             } else {
    -974                 s += '0';
    -975             }
    -976         }
    -977         this.setByBinaryString(s);
    -978     };
    -979 
    -980     /**
    -981      * generate an array of falses with specified length<br/>
    -982      * @name newFalseArray
    -983      * @memberOf KJUR.asn1.DERBitString
    -984      * @function
    -985      * @param {Integer} nLength length of array to generate
    -986      * @return {array} array of boolean falses
    -987      * @description
    -988      * This static method may be useful to initialize boolean array.
    -989      * @example
    -990      * o = new KJUR.asn1.DERBitString();
    -991      * o.newFalseArray(3) → [false, false, false]
    -992      */
    -993     this.newFalseArray = function(nLength) {
    -994         var a = new Array(nLength);
    -995         for (var i = 0; i < nLength; i++) {
    -996             a[i] = false;
    -997         }
    -998         return a;
    -999     };
    -1000 
    -1001     this.getFreshValueHex = function() {
    -1002         return this.hV;
    -1003     };
    -1004 
    -1005     if (typeof params != "undefined") {
    -1006         if (typeof params == "string" && params.toLowerCase().match(/^[0-9a-f]+$/)) {
    -1007             this.setHexValueIncludingUnusedBits(params);
    -1008         } else if (typeof params['hex'] != "undefined") {
    -1009             this.setHexValueIncludingUnusedBits(params['hex']);
    -1010         } else if (typeof params['bin'] != "undefined") {
    -1011             this.setByBinaryString(params['bin']);
    -1012         } else if (typeof params['array'] != "undefined") {
    -1013             this.setByBooleanArray(params['array']);
    -1014         }
    -1015     }
    -1016 };
    -1017 YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
    -1018 
    -1019 // ********************************************************************
    -1020 /**
    -1021  * class for ASN.1 DER OctetString<br/>
    -1022  * @name KJUR.asn1.DEROctetString
    -1023  * @class class for ASN.1 DER OctetString
    -1024  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1025  * @extends KJUR.asn1.DERAbstractString
    -1026  * @description
    -1027  * This class provides ASN.1 OctetString simple type.<br/>
    -1028  * Supported "params" attributes are:
    -1029  * <ul>
    -1030  * <li>str - to set a string as a value</li>
    -1031  * <li>hex - to set a hexadecimal string as a value</li>
    -1032  * <li>obj - to set a encapsulated ASN.1 value by JSON object 
    -1033  * which is defined in {@link KJUR.asn1.ASN1Util.newObject}</li>
    -1034  * </ul>
    -1035  * NOTE: A parameter 'obj' have been supported 
    -1036  * for "OCTET STRING, encapsulates" structure.
    -1037  * since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
    -1038  * @see KJUR.asn1.DERAbstractString - superclass
    -1039  * @example
    -1040  * // default constructor
    -1041  * o = new KJUR.asn1.DEROctetString();
    -1042  * // initialize with string
    -1043  * o = new KJUR.asn1.DEROctetString({str: "aaa"});
    -1044  * // initialize with hexadecimal string
    -1045  * o = new KJUR.asn1.DEROctetString({hex: "616161"});
    -1046  * // initialize with ASN1Util.newObject argument 
    -1047  * o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    -1048  * // above generates a ASN.1 data like this:
    -1049  * // OCTET STRING, encapsulates {
    -1050  * //   SEQUENCE {
    -1051  * //     INTEGER 3
    -1052  * //     PrintableString 'aaa'
    -1053  * //     }
    -1054  * //   } 
    -1055  */
    -1056 KJUR.asn1.DEROctetString = function(params) {
    -1057     if (params !== undefined && typeof params.obj !== "undefined") {
    -1058 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    -1059 	params.hex = o.getEncodedHex();
    -1060     }
    -1061     KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
    -1062     this.hT = "04";
    -1063 };
    -1064 YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
    -1065 
    -1066 // ********************************************************************
    -1067 /**
    -1068  * class for ASN.1 DER Null
    -1069  * @name KJUR.asn1.DERNull
    -1070  * @class class for ASN.1 DER Null
    -1071  * @extends KJUR.asn1.ASN1Object
    -1072  * @description
    -1073  * @see KJUR.asn1.ASN1Object - superclass
    -1074  */
    -1075 KJUR.asn1.DERNull = function() {
    -1076     KJUR.asn1.DERNull.superclass.constructor.call(this);
    -1077     this.hT = "05";
    -1078     this.hTLV = "0500";
    -1079 };
    -1080 YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
    -1081 
    -1082 // ********************************************************************
    -1083 /**
    -1084  * class for ASN.1 DER ObjectIdentifier
    -1085  * @name KJUR.asn1.DERObjectIdentifier
    -1086  * @class class for ASN.1 DER ObjectIdentifier
    -1087  * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})
    -1088  * @extends KJUR.asn1.ASN1Object
    -1089  * @description
    -1090  * <br/>
    -1091  * As for argument 'params' for constructor, you can specify one of
    -1092  * following properties:
    -1093  * <ul>
    -1094  * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
    -1095  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1096  * </ul>
    -1097  * NOTE: 'params' can be omitted.
    -1098  */
    -1099 KJUR.asn1.DERObjectIdentifier = function(params) {
    -1100     var itox = function(i) {
    -1101         var h = i.toString(16);
    -1102         if (h.length == 1) h = '0' + h;
    -1103         return h;
    -1104     };
    -1105     var roidtox = function(roid) {
    -1106         var h = '';
    -1107         var bi = new BigInteger(roid, 10);
    -1108         var b = bi.toString(2);
    -1109         var padLen = 7 - b.length % 7;
    -1110         if (padLen == 7) padLen = 0;
    -1111         var bPad = '';
    -1112         for (var i = 0; i < padLen; i++) bPad += '0';
    -1113         b = bPad + b;
    -1114         for (var i = 0; i < b.length - 1; i += 7) {
    -1115             var b8 = b.substr(i, 7);
    -1116             if (i != b.length - 7) b8 = '1' + b8;
    -1117             h += itox(parseInt(b8, 2));
    -1118         }
    -1119         return h;
    -1120     }
    -1121 
    -1122     KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
    -1123     this.hT = "06";
    -1124 
    -1125     /**
    -1126      * set value by a hexadecimal string
    -1127      * @name setValueHex
    -1128      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1129      * @function
    -1130      * @param {String} newHexString hexadecimal value of OID bytes
    -1131      */
    -1132     this.setValueHex = function(newHexString) {
    -1133         this.hTLV = null;
    -1134         this.isModified = true;
    -1135         this.s = null;
    -1136         this.hV = newHexString;
    -1137     };
    -1138 
    -1139     /**
    -1140      * set value by a OID string<br/>
    -1141      * @name setValueOidString
    -1142      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1143      * @function
    -1144      * @param {String} oidString OID string (ex. 2.5.4.13)
    -1145      * @example
    -1146      * o = new KJUR.asn1.DERObjectIdentifier();
    -1147      * o.setValueOidString("2.5.4.13");
    -1148      */
    -1149     this.setValueOidString = function(oidString) {
    -1150         if (! oidString.match(/^[0-9.]+$/)) {
    -1151             throw "malformed oid string: " + oidString;
    -1152         }
    -1153         var h = '';
    -1154         var a = oidString.split('.');
    -1155         var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
    -1156         h += itox(i0);
    -1157         a.splice(0, 2);
    -1158         for (var i = 0; i < a.length; i++) {
    -1159             h += roidtox(a[i]);
    +447         if (this.hV.length % 2 == 1) {
    +448             throw "value hex must be even length: n=" + hV.length + ",v=" + this.hV;
    +449         }
    +450         var n = this.hV.length / 2;
    +451         var hN = n.toString(16);
    +452         if (hN.length % 2 == 1) {
    +453             hN = "0" + hN;
    +454         }
    +455         if (n < 128) {
    +456             return hN;
    +457         } else {
    +458             var hNlen = hN.length / 2;
    +459             if (hNlen > 15) {
    +460                 throw "ASN.1 length too long to represent by 8x: n = " + n.toString(16);
    +461             }
    +462             var head = 128 + hNlen;
    +463             return head.toString(16) + hN;
    +464         }
    +465     };
    +466 
    +467     /**
    +468      * get hexadecimal string of ASN.1 TLV bytes
    +469      * @name getEncodedHex
    +470      * @memberOf KJUR.asn1.ASN1Object#
    +471      * @function
    +472      * @return {String} hexadecimal string of ASN.1 TLV
    +473      */
    +474     this.getEncodedHex = function() {
    +475         if (this.hTLV == null || this.isModified) {
    +476             this.hV = this.getFreshValueHex();
    +477             this.hL = this.getLengthHexFromValue();
    +478             this.hTLV = this.hT + this.hL + this.hV;
    +479             this.isModified = false;
    +480             //alert("first time: " + this.hTLV);
    +481         }
    +482         return this.hTLV;
    +483     };
    +484 
    +485     /**
    +486      * get hexadecimal string of ASN.1 TLV value(V) bytes
    +487      * @name getValueHex
    +488      * @memberOf KJUR.asn1.ASN1Object#
    +489      * @function
    +490      * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes
    +491      */
    +492     this.getValueHex = function() {
    +493         this.getEncodedHex();
    +494         return this.hV;
    +495     }
    +496 
    +497     this.getFreshValueHex = function() {
    +498         return '';
    +499     };
    +500 };
    +501 
    +502 // == BEGIN DERAbstractString ================================================
    +503 /**
    +504  * base class for ASN.1 DER string classes
    +505  * @name KJUR.asn1.DERAbstractString
    +506  * @class base class for ASN.1 DER string classes
    +507  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +508  * @property {String} s internal string of value
    +509  * @extends KJUR.asn1.ASN1Object
    +510  * @description
    +511  * <br/>
    +512  * As for argument 'params' for constructor, you can specify one of
    +513  * following properties:
    +514  * <ul>
    +515  * <li>str - specify initial ASN.1 value(V) by a string</li>
    +516  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +517  * </ul>
    +518  * NOTE: 'params' can be omitted.
    +519  */
    +520 KJUR.asn1.DERAbstractString = function(params) {
    +521     KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
    +522     var s = null;
    +523     var hV = null;
    +524 
    +525     /**
    +526      * get string value of this string object
    +527      * @name getString
    +528      * @memberOf KJUR.asn1.DERAbstractString#
    +529      * @function
    +530      * @return {String} string value of this string object
    +531      */
    +532     this.getString = function() {
    +533         return this.s;
    +534     };
    +535 
    +536     /**
    +537      * set value by a string
    +538      * @name setString
    +539      * @memberOf KJUR.asn1.DERAbstractString#
    +540      * @function
    +541      * @param {String} newS value by a string to set
    +542      * @description
    +543      * This method set value by string. <br/>
    +544      * NOTE: This method assumes that the argument string is
    +545      * UTF-8 encoded even though ASN.1 primitive 
    +546      * such as IA5String or PrintableString doesn't
    +547      * support all of UTF-8 characters.
    +548      * @example
    +549      * o = new KJUR.asn1.DERIA5String();
    +550      * o.setString("abc");
    +551      * o.setString("あいう");
    +552      */
    +553     this.setString = function(newS) {
    +554         this.hTLV = null;
    +555         this.isModified = true;
    +556         this.s = newS;
    +557         this.hV = utf8tohex(this.s).toLowerCase();
    +558     };
    +559 
    +560     /**
    +561      * set value by a hexadecimal string
    +562      * @name setStringHex
    +563      * @memberOf KJUR.asn1.DERAbstractString#
    +564      * @function
    +565      * @param {String} newHexString value by a hexadecimal string to set
    +566      */
    +567     this.setStringHex = function(newHexString) {
    +568         this.hTLV = null;
    +569         this.isModified = true;
    +570         this.s = null;
    +571         this.hV = newHexString;
    +572     };
    +573 
    +574     this.getFreshValueHex = function() {
    +575         return this.hV;
    +576     };
    +577 
    +578     if (typeof params != "undefined") {
    +579         if (typeof params == "string") {
    +580             this.setString(params);
    +581         } else if (typeof params['str'] != "undefined") {
    +582             this.setString(params['str']);
    +583         } else if (typeof params['hex'] != "undefined") {
    +584             this.setStringHex(params['hex']);
    +585         }
    +586     }
    +587 };
    +588 YAHOO.lang.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);
    +589 // == END   DERAbstractString ================================================
    +590 
    +591 // == BEGIN DERAbstractTime ==================================================
    +592 /**
    +593  * base class for ASN.1 DER Generalized/UTCTime class
    +594  * @name KJUR.asn1.DERAbstractTime
    +595  * @class base class for ASN.1 DER Generalized/UTCTime class
    +596  * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
    +597  * @extends KJUR.asn1.ASN1Object
    +598  * @description
    +599  * @see KJUR.asn1.ASN1Object - superclass
    +600  */
    +601 KJUR.asn1.DERAbstractTime = function(params) {
    +602     KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
    +603     var s = null;
    +604     var date = null;
    +605 
    +606     // --- PRIVATE METHODS --------------------
    +607     this.localDateToUTC = function(d) {
    +608         var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
    +609         var utcDate = new Date(utc);
    +610         return utcDate;
    +611     };
    +612 
    +613     /*
    +614      * format date string by Data object
    +615      * @name formatDate
    +616      * @memberOf KJUR.asn1.AbstractTime;
    +617      * @param {Date} dateObject 
    +618      * @param {string} type 'utc' or 'gen'
    +619      * @param {boolean} withMillis flag for with millisections or not
    +620      * @description
    +621      * 'withMillis' flag is supported from asn1 1.0.6.
    +622      */
    +623     this.formatDate = function(dateObject, type, withMillis) {
    +624         var pad = this.zeroPadding;
    +625         var d = this.localDateToUTC(dateObject);
    +626         var year = String(d.getFullYear());
    +627         if (type == 'utc') year = year.substr(2, 2);
    +628         var month = pad(String(d.getMonth() + 1), 2);
    +629         var day = pad(String(d.getDate()), 2);
    +630         var hour = pad(String(d.getHours()), 2);
    +631         var min = pad(String(d.getMinutes()), 2);
    +632         var sec = pad(String(d.getSeconds()), 2);
    +633         var s = year + month + day + hour + min + sec;
    +634         if (withMillis === true) {
    +635             var millis = d.getMilliseconds();
    +636             if (millis != 0) {
    +637                 var sMillis = pad(String(millis), 3);
    +638                 sMillis = sMillis.replace(/[0]+$/, "");
    +639                 s = s + "." + sMillis;
    +640             }
    +641         }
    +642         return s + "Z";
    +643     };
    +644 
    +645     this.zeroPadding = function(s, len) {
    +646         if (s.length >= len) return s;
    +647         return new Array(len - s.length + 1).join('0') + s;
    +648     };
    +649 
    +650     // --- PUBLIC METHODS --------------------
    +651     /**
    +652      * get string value of this string object
    +653      * @name getString
    +654      * @memberOf KJUR.asn1.DERAbstractTime#
    +655      * @function
    +656      * @return {String} string value of this time object
    +657      */
    +658     this.getString = function() {
    +659         return this.s;
    +660     };
    +661 
    +662     /**
    +663      * set value by a string
    +664      * @name setString
    +665      * @memberOf KJUR.asn1.DERAbstractTime#
    +666      * @function
    +667      * @param {String} newS value by a string to set such like "130430235959Z"
    +668      */
    +669     this.setString = function(newS) {
    +670         this.hTLV = null;
    +671         this.isModified = true;
    +672         this.s = newS;
    +673         this.hV = stohex(newS);
    +674     };
    +675 
    +676     /**
    +677      * set value by a Date object
    +678      * @name setByDateValue
    +679      * @memberOf KJUR.asn1.DERAbstractTime#
    +680      * @function
    +681      * @param {Integer} year year of date (ex. 2013)
    +682      * @param {Integer} month month of date between 1 and 12 (ex. 12)
    +683      * @param {Integer} day day of month
    +684      * @param {Integer} hour hours of date
    +685      * @param {Integer} min minutes of date
    +686      * @param {Integer} sec seconds of date
    +687      */
    +688     this.setByDateValue = function(year, month, day, hour, min, sec) {
    +689         var dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));
    +690         this.setByDate(dateObject);
    +691     };
    +692 
    +693     this.getFreshValueHex = function() {
    +694         return this.hV;
    +695     };
    +696 };
    +697 YAHOO.lang.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);
    +698 // == END   DERAbstractTime ==================================================
    +699 
    +700 // == BEGIN DERAbstractStructured ============================================
    +701 /**
    +702  * base class for ASN.1 DER structured class
    +703  * @name KJUR.asn1.DERAbstractStructured
    +704  * @class base class for ASN.1 DER structured class
    +705  * @property {Array} asn1Array internal array of ASN1Object
    +706  * @extends KJUR.asn1.ASN1Object
    +707  * @description
    +708  * @see KJUR.asn1.ASN1Object - superclass
    +709  */
    +710 KJUR.asn1.DERAbstractStructured = function(params) {
    +711     KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
    +712     var asn1Array = null;
    +713 
    +714     /**
    +715      * set value by array of ASN1Object
    +716      * @name setByASN1ObjectArray
    +717      * @memberOf KJUR.asn1.DERAbstractStructured#
    +718      * @function
    +719      * @param {array} asn1ObjectArray array of ASN1Object to set
    +720      */
    +721     this.setByASN1ObjectArray = function(asn1ObjectArray) {
    +722         this.hTLV = null;
    +723         this.isModified = true;
    +724         this.asn1Array = asn1ObjectArray;
    +725     };
    +726 
    +727     /**
    +728      * append an ASN1Object to internal array
    +729      * @name appendASN1Object
    +730      * @memberOf KJUR.asn1.DERAbstractStructured#
    +731      * @function
    +732      * @param {ASN1Object} asn1Object to add
    +733      */
    +734     this.appendASN1Object = function(asn1Object) {
    +735         this.hTLV = null;
    +736         this.isModified = true;
    +737         this.asn1Array.push(asn1Object);
    +738     };
    +739 
    +740     this.asn1Array = new Array();
    +741     if (typeof params != "undefined") {
    +742         if (typeof params['array'] != "undefined") {
    +743             this.asn1Array = params['array'];
    +744         }
    +745     }
    +746 };
    +747 YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);
    +748 
    +749 
    +750 // ********************************************************************
    +751 //  ASN.1 Object Classes
    +752 // ********************************************************************
    +753 
    +754 // ********************************************************************
    +755 /**
    +756  * class for ASN.1 DER Boolean
    +757  * @name KJUR.asn1.DERBoolean
    +758  * @class class for ASN.1 DER Boolean
    +759  * @extends KJUR.asn1.ASN1Object
    +760  * @description
    +761  * @see KJUR.asn1.ASN1Object - superclass
    +762  */
    +763 KJUR.asn1.DERBoolean = function() {
    +764     KJUR.asn1.DERBoolean.superclass.constructor.call(this);
    +765     this.hT = "01";
    +766     this.hTLV = "0101ff";
    +767 };
    +768 YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
    +769 
    +770 // ********************************************************************
    +771 /**
    +772  * class for ASN.1 DER Integer
    +773  * @name KJUR.asn1.DERInteger
    +774  * @class class for ASN.1 DER Integer
    +775  * @extends KJUR.asn1.ASN1Object
    +776  * @description
    +777  * <br/>
    +778  * As for argument 'params' for constructor, you can specify one of
    +779  * following properties:
    +780  * <ul>
    +781  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    +782  * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
    +783  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +784  * </ul>
    +785  * NOTE: 'params' can be omitted.
    +786  */
    +787 KJUR.asn1.DERInteger = function(params) {
    +788     KJUR.asn1.DERInteger.superclass.constructor.call(this);
    +789     this.hT = "02";
    +790 
    +791     /**
    +792      * set value by Tom Wu's BigInteger object
    +793      * @name setByBigInteger
    +794      * @memberOf KJUR.asn1.DERInteger#
    +795      * @function
    +796      * @param {BigInteger} bigIntegerValue to set
    +797      */
    +798     this.setByBigInteger = function(bigIntegerValue) {
    +799         this.hTLV = null;
    +800         this.isModified = true;
    +801         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    +802     };
    +803 
    +804     /**
    +805      * set value by integer value
    +806      * @name setByInteger
    +807      * @memberOf KJUR.asn1.DERInteger
    +808      * @function
    +809      * @param {Integer} integer value to set
    +810      */
    +811     this.setByInteger = function(intValue) {
    +812         var bi = new BigInteger(String(intValue), 10);
    +813         this.setByBigInteger(bi);
    +814     };
    +815 
    +816     /**
    +817      * set value by integer value
    +818      * @name setValueHex
    +819      * @memberOf KJUR.asn1.DERInteger#
    +820      * @function
    +821      * @param {String} hexadecimal string of integer value
    +822      * @description
    +823      * <br/>
    +824      * NOTE: Value shall be represented by minimum octet length of
    +825      * two's complement representation.
    +826      * @example
    +827      * new KJUR.asn1.DERInteger(123);
    +828      * new KJUR.asn1.DERInteger({'int': 123});
    +829      * new KJUR.asn1.DERInteger({'hex': '1fad'});
    +830      */
    +831     this.setValueHex = function(newHexString) {
    +832         this.hV = newHexString;
    +833     };
    +834 
    +835     this.getFreshValueHex = function() {
    +836         return this.hV;
    +837     };
    +838 
    +839     if (typeof params != "undefined") {
    +840         if (typeof params['bigint'] != "undefined") {
    +841             this.setByBigInteger(params['bigint']);
    +842         } else if (typeof params['int'] != "undefined") {
    +843             this.setByInteger(params['int']);
    +844         } else if (typeof params == "number") {
    +845             this.setByInteger(params);
    +846         } else if (typeof params['hex'] != "undefined") {
    +847             this.setValueHex(params['hex']);
    +848         }
    +849     }
    +850 };
    +851 YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
    +852 
    +853 // ********************************************************************
    +854 /**
    +855  * class for ASN.1 DER encoded BitString primitive
    +856  * @name KJUR.asn1.DERBitString
    +857  * @class class for ASN.1 DER encoded BitString primitive
    +858  * @extends KJUR.asn1.ASN1Object
    +859  * @description 
    +860  * <br/>
    +861  * As for argument 'params' for constructor, you can specify one of
    +862  * following properties:
    +863  * <ul>
    +864  * <li>bin - specify binary string (ex. '10111')</li>
    +865  * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
    +866  * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
    +867  * <li>obj - specify {@link KJUR.asn1.ASN1Util.newObject} 
    +868  * argument for "BitString encapsulates" structure.</li>
    +869  * </ul>
    +870  * NOTE1: 'params' can be omitted.<br/>
    +871  * NOTE2: 'obj' parameter have been supported since
    +872  * asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).<br/>
    +873  * @example
    +874  * // default constructor
    +875  * o = new KJUR.asn1.DERBitString();
    +876  * // initialize with binary string
    +877  * o = new KJUR.asn1.DERBitString({bin: "1011"});
    +878  * // initialize with boolean array
    +879  * o = new KJUR.asn1.DERBitString({array: [true,false,true,true]});
    +880  * // initialize with hexadecimal string (04 is unused bits)
    +881  * o = new KJUR.asn1.DEROctetString({hex: "04bac0"});
    +882  * // initialize with ASN1Util.newObject argument for encapsulated
    +883  * o = new KJUR.asn1.DERBitString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    +884  * // above generates a ASN.1 data like this:
    +885  * // BIT STRING, encapsulates {
    +886  * //   SEQUENCE {
    +887  * //     INTEGER 3
    +888  * //     PrintableString 'aaa'
    +889  * //     }
    +890  * //   } 
    +891  */
    +892 KJUR.asn1.DERBitString = function(params) {
    +893     if (params !== undefined && typeof params.obj !== "undefined") {
    +894 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    +895 	params.hex = "00" + o.getEncodedHex();
    +896     }
    +897     KJUR.asn1.DERBitString.superclass.constructor.call(this);
    +898     this.hT = "03";
    +899 
    +900     /**
    +901      * set ASN.1 value(V) by a hexadecimal string including unused bits
    +902      * @name setHexValueIncludingUnusedBits
    +903      * @memberOf KJUR.asn1.DERBitString#
    +904      * @function
    +905      * @param {String} newHexStringIncludingUnusedBits
    +906      */
    +907     this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
    +908         this.hTLV = null;
    +909         this.isModified = true;
    +910         this.hV = newHexStringIncludingUnusedBits;
    +911     };
    +912 
    +913     /**
    +914      * set ASN.1 value(V) by unused bit and hexadecimal string of value
    +915      * @name setUnusedBitsAndHexValue
    +916      * @memberOf KJUR.asn1.DERBitString#
    +917      * @function
    +918      * @param {Integer} unusedBits
    +919      * @param {String} hValue
    +920      */
    +921     this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
    +922         if (unusedBits < 0 || 7 < unusedBits) {
    +923             throw "unused bits shall be from 0 to 7: u = " + unusedBits;
    +924         }
    +925         var hUnusedBits = "0" + unusedBits;
    +926         this.hTLV = null;
    +927         this.isModified = true;
    +928         this.hV = hUnusedBits + hValue;
    +929     };
    +930 
    +931     /**
    +932      * set ASN.1 DER BitString by binary string<br/>
    +933      * @name setByBinaryString
    +934      * @memberOf KJUR.asn1.DERBitString#
    +935      * @function
    +936      * @param {String} binaryString binary value string (i.e. '10111')
    +937      * @description
    +938      * Its unused bits will be calculated automatically by length of 
    +939      * 'binaryValue'. <br/>
    +940      * NOTE: Trailing zeros '0' will be ignored.
    +941      * @example
    +942      * o = new KJUR.asn1.DERBitString();
    +943      * o.setByBooleanArray("01011");
    +944      */
    +945     this.setByBinaryString = function(binaryString) {
    +946         binaryString = binaryString.replace(/0+$/, '');
    +947         var unusedBits = 8 - binaryString.length % 8;
    +948         if (unusedBits == 8) unusedBits = 0;
    +949         for (var i = 0; i <= unusedBits; i++) {
    +950             binaryString += '0';
    +951         }
    +952         var h = '';
    +953         for (var i = 0; i < binaryString.length - 1; i += 8) {
    +954             var b = binaryString.substr(i, 8);
    +955             var x = parseInt(b, 2).toString(16);
    +956             if (x.length == 1) x = '0' + x;
    +957             h += x;  
    +958         }
    +959         this.hTLV = null;
    +960         this.isModified = true;
    +961         this.hV = '0' + unusedBits + h;
    +962     };
    +963 
    +964     /**
    +965      * set ASN.1 TLV value(V) by an array of boolean<br/>
    +966      * @name setByBooleanArray
    +967      * @memberOf KJUR.asn1.DERBitString#
    +968      * @function
    +969      * @param {array} booleanArray array of boolean (ex. [true, false, true])
    +970      * @description
    +971      * NOTE: Trailing falses will be ignored in the ASN.1 DER Object.
    +972      * @example
    +973      * o = new KJUR.asn1.DERBitString();
    +974      * o.setByBooleanArray([false, true, false, true, true]);
    +975      */
    +976     this.setByBooleanArray = function(booleanArray) {
    +977         var s = '';
    +978         for (var i = 0; i < booleanArray.length; i++) {
    +979             if (booleanArray[i] == true) {
    +980                 s += '1';
    +981             } else {
    +982                 s += '0';
    +983             }
    +984         }
    +985         this.setByBinaryString(s);
    +986     };
    +987 
    +988     /**
    +989      * generate an array of falses with specified length<br/>
    +990      * @name newFalseArray
    +991      * @memberOf KJUR.asn1.DERBitString
    +992      * @function
    +993      * @param {Integer} nLength length of array to generate
    +994      * @return {array} array of boolean falses
    +995      * @description
    +996      * This static method may be useful to initialize boolean array.
    +997      * @example
    +998      * o = new KJUR.asn1.DERBitString();
    +999      * o.newFalseArray(3) → [false, false, false]
    +1000      */
    +1001     this.newFalseArray = function(nLength) {
    +1002         var a = new Array(nLength);
    +1003         for (var i = 0; i < nLength; i++) {
    +1004             a[i] = false;
    +1005         }
    +1006         return a;
    +1007     };
    +1008 
    +1009     this.getFreshValueHex = function() {
    +1010         return this.hV;
    +1011     };
    +1012 
    +1013     if (typeof params != "undefined") {
    +1014         if (typeof params == "string" && params.toLowerCase().match(/^[0-9a-f]+$/)) {
    +1015             this.setHexValueIncludingUnusedBits(params);
    +1016         } else if (typeof params['hex'] != "undefined") {
    +1017             this.setHexValueIncludingUnusedBits(params['hex']);
    +1018         } else if (typeof params['bin'] != "undefined") {
    +1019             this.setByBinaryString(params['bin']);
    +1020         } else if (typeof params['array'] != "undefined") {
    +1021             this.setByBooleanArray(params['array']);
    +1022         }
    +1023     }
    +1024 };
    +1025 YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
    +1026 
    +1027 // ********************************************************************
    +1028 /**
    +1029  * class for ASN.1 DER OctetString<br/>
    +1030  * @name KJUR.asn1.DEROctetString
    +1031  * @class class for ASN.1 DER OctetString
    +1032  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    +1033  * @extends KJUR.asn1.DERAbstractString
    +1034  * @description
    +1035  * This class provides ASN.1 OctetString simple type.<br/>
    +1036  * Supported "params" attributes are:
    +1037  * <ul>
    +1038  * <li>str - to set a string as a value</li>
    +1039  * <li>hex - to set a hexadecimal string as a value</li>
    +1040  * <li>obj - to set a encapsulated ASN.1 value by JSON object 
    +1041  * which is defined in {@link KJUR.asn1.ASN1Util.newObject}</li>
    +1042  * </ul>
    +1043  * NOTE: A parameter 'obj' have been supported 
    +1044  * for "OCTET STRING, encapsulates" structure.
    +1045  * since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
    +1046  * @see KJUR.asn1.DERAbstractString - superclass
    +1047  * @example
    +1048  * // default constructor
    +1049  * o = new KJUR.asn1.DEROctetString();
    +1050  * // initialize with string
    +1051  * o = new KJUR.asn1.DEROctetString({str: "aaa"});
    +1052  * // initialize with hexadecimal string
    +1053  * o = new KJUR.asn1.DEROctetString({hex: "616161"});
    +1054  * // initialize with ASN1Util.newObject argument 
    +1055  * o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
    +1056  * // above generates a ASN.1 data like this:
    +1057  * // OCTET STRING, encapsulates {
    +1058  * //   SEQUENCE {
    +1059  * //     INTEGER 3
    +1060  * //     PrintableString 'aaa'
    +1061  * //     }
    +1062  * //   } 
    +1063  */
    +1064 KJUR.asn1.DEROctetString = function(params) {
    +1065     if (params !== undefined && typeof params.obj !== "undefined") {
    +1066 	var o = KJUR.asn1.ASN1Util.newObject(params.obj);
    +1067 	params.hex = o.getEncodedHex();
    +1068     }
    +1069     KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
    +1070     this.hT = "04";
    +1071 };
    +1072 YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
    +1073 
    +1074 // ********************************************************************
    +1075 /**
    +1076  * class for ASN.1 DER Null
    +1077  * @name KJUR.asn1.DERNull
    +1078  * @class class for ASN.1 DER Null
    +1079  * @extends KJUR.asn1.ASN1Object
    +1080  * @description
    +1081  * @see KJUR.asn1.ASN1Object - superclass
    +1082  */
    +1083 KJUR.asn1.DERNull = function() {
    +1084     KJUR.asn1.DERNull.superclass.constructor.call(this);
    +1085     this.hT = "05";
    +1086     this.hTLV = "0500";
    +1087 };
    +1088 YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
    +1089 
    +1090 // ********************************************************************
    +1091 /**
    +1092  * class for ASN.1 DER ObjectIdentifier
    +1093  * @name KJUR.asn1.DERObjectIdentifier
    +1094  * @class class for ASN.1 DER ObjectIdentifier
    +1095  * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})
    +1096  * @extends KJUR.asn1.ASN1Object
    +1097  * @description
    +1098  * <br/>
    +1099  * As for argument 'params' for constructor, you can specify one of
    +1100  * following properties:
    +1101  * <ul>
    +1102  * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
    +1103  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    +1104  * </ul>
    +1105  * NOTE: 'params' can be omitted.
    +1106  */
    +1107 KJUR.asn1.DERObjectIdentifier = function(params) {
    +1108     var itox = function(i) {
    +1109         var h = i.toString(16);
    +1110         if (h.length == 1) h = '0' + h;
    +1111         return h;
    +1112     };
    +1113     var roidtox = function(roid) {
    +1114         var h = '';
    +1115         var bi = new BigInteger(roid, 10);
    +1116         var b = bi.toString(2);
    +1117         var padLen = 7 - b.length % 7;
    +1118         if (padLen == 7) padLen = 0;
    +1119         var bPad = '';
    +1120         for (var i = 0; i < padLen; i++) bPad += '0';
    +1121         b = bPad + b;
    +1122         for (var i = 0; i < b.length - 1; i += 7) {
    +1123             var b8 = b.substr(i, 7);
    +1124             if (i != b.length - 7) b8 = '1' + b8;
    +1125             h += itox(parseInt(b8, 2));
    +1126         }
    +1127         return h;
    +1128     }
    +1129 
    +1130     KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
    +1131     this.hT = "06";
    +1132 
    +1133     /**
    +1134      * set value by a hexadecimal string
    +1135      * @name setValueHex
    +1136      * @memberOf KJUR.asn1.DERObjectIdentifier#
    +1137      * @function
    +1138      * @param {String} newHexString hexadecimal value of OID bytes
    +1139      */
    +1140     this.setValueHex = function(newHexString) {
    +1141         this.hTLV = null;
    +1142         this.isModified = true;
    +1143         this.s = null;
    +1144         this.hV = newHexString;
    +1145     };
    +1146 
    +1147     /**
    +1148      * set value by a OID string<br/>
    +1149      * @name setValueOidString
    +1150      * @memberOf KJUR.asn1.DERObjectIdentifier#
    +1151      * @function
    +1152      * @param {String} oidString OID string (ex. 2.5.4.13)
    +1153      * @example
    +1154      * o = new KJUR.asn1.DERObjectIdentifier();
    +1155      * o.setValueOidString("2.5.4.13");
    +1156      */
    +1157     this.setValueOidString = function(oidString) {
    +1158         if (! oidString.match(/^[0-9.]+$/)) {
    +1159             throw "malformed oid string: " + oidString;
     1160         }
    -1161         this.hTLV = null;
    -1162         this.isModified = true;
    -1163         this.s = null;
    -1164         this.hV = h;
    -1165     };
    -1166 
    -1167     /**
    -1168      * set value by a OID name
    -1169      * @name setValueName
    -1170      * @memberOf KJUR.asn1.DERObjectIdentifier#
    -1171      * @function
    -1172      * @param {String} oidName OID name (ex. 'serverAuth')
    -1173      * @since 1.0.1
    -1174      * @description
    -1175      * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.
    -1176      * Otherwise raise error.
    -1177      * @example
    -1178      * o = new KJUR.asn1.DERObjectIdentifier();
    -1179      * o.setValueName("serverAuth");
    -1180      */
    -1181     this.setValueName = function(oidName) {
    -1182 	var oid = KJUR.asn1.x509.OID.name2oid(oidName);
    -1183 	if (oid !== '') {
    -1184             this.setValueOidString(oid);
    -1185         } else {
    -1186             throw "DERObjectIdentifier oidName undefined: " + oidName;
    -1187         }
    -1188     };
    -1189 
    -1190     this.getFreshValueHex = function() {
    -1191         return this.hV;
    -1192     };
    -1193 
    -1194     if (params !== undefined) {
    -1195         if (typeof params === "string") {
    -1196 	    if (params.match(/^[0-2].[0-9.]+$/)) {
    -1197 		this.setValueOidString(params);
    -1198 	    } else {
    -1199 		this.setValueName(params);
    -1200 	    }
    -1201         } else if (params.oid !== undefined) {
    -1202             this.setValueOidString(params.oid);
    -1203         } else if (params.hex !== undefined) {
    -1204             this.setValueHex(params.hex);
    -1205         } else if (params.name !== undefined) {
    -1206             this.setValueName(params.name);
    -1207         }
    -1208     }
    -1209 };
    -1210 YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);
    -1211 
    -1212 // ********************************************************************
    -1213 /**
    -1214  * class for ASN.1 DER Enumerated
    -1215  * @name KJUR.asn1.DEREnumerated
    -1216  * @class class for ASN.1 DER Enumerated
    -1217  * @extends KJUR.asn1.ASN1Object
    -1218  * @description
    -1219  * <br/>
    -1220  * As for argument 'params' for constructor, you can specify one of
    -1221  * following properties:
    -1222  * <ul>
    -1223  * <li>int - specify initial ASN.1 value(V) by integer value</li>
    -1224  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1225  * </ul>
    -1226  * NOTE: 'params' can be omitted.
    -1227  * @example
    -1228  * new KJUR.asn1.DEREnumerated(123);
    -1229  * new KJUR.asn1.DEREnumerated({int: 123});
    -1230  * new KJUR.asn1.DEREnumerated({hex: '1fad'});
    -1231  */
    -1232 KJUR.asn1.DEREnumerated = function(params) {
    -1233     KJUR.asn1.DEREnumerated.superclass.constructor.call(this);
    -1234     this.hT = "0a";
    -1235 
    -1236     /**
    -1237      * set value by Tom Wu's BigInteger object
    -1238      * @name setByBigInteger
    -1239      * @memberOf KJUR.asn1.DEREnumerated#
    -1240      * @function
    -1241      * @param {BigInteger} bigIntegerValue to set
    -1242      */
    -1243     this.setByBigInteger = function(bigIntegerValue) {
    -1244         this.hTLV = null;
    -1245         this.isModified = true;
    -1246         this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
    -1247     };
    -1248 
    -1249     /**
    -1250      * set value by integer value
    -1251      * @name setByInteger
    -1252      * @memberOf KJUR.asn1.DEREnumerated#
    -1253      * @function
    -1254      * @param {Integer} integer value to set
    -1255      */
    -1256     this.setByInteger = function(intValue) {
    -1257         var bi = new BigInteger(String(intValue), 10);
    -1258         this.setByBigInteger(bi);
    -1259     };
    -1260 
    -1261     /**
    -1262      * set value by integer value
    -1263      * @name setValueHex
    -1264      * @memberOf KJUR.asn1.DEREnumerated#
    -1265      * @function
    -1266      * @param {String} hexadecimal string of integer value
    -1267      * @description
    -1268      * <br/>
    -1269      * NOTE: Value shall be represented by minimum octet length of
    -1270      * two's complement representation.
    -1271      */
    -1272     this.setValueHex = function(newHexString) {
    -1273         this.hV = newHexString;
    -1274     };
    -1275 
    -1276     this.getFreshValueHex = function() {
    -1277         return this.hV;
    -1278     };
    -1279 
    -1280     if (typeof params != "undefined") {
    -1281         if (typeof params['int'] != "undefined") {
    -1282             this.setByInteger(params['int']);
    -1283         } else if (typeof params == "number") {
    -1284             this.setByInteger(params);
    -1285         } else if (typeof params['hex'] != "undefined") {
    -1286             this.setValueHex(params['hex']);
    -1287         }
    -1288     }
    -1289 };
    -1290 YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object);
    -1291 
    -1292 // ********************************************************************
    -1293 /**
    -1294  * class for ASN.1 DER UTF8String
    -1295  * @name KJUR.asn1.DERUTF8String
    -1296  * @class class for ASN.1 DER UTF8String
    -1297  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1298  * @extends KJUR.asn1.DERAbstractString
    -1299  * @description
    -1300  * @see KJUR.asn1.DERAbstractString - superclass
    -1301  */
    -1302 KJUR.asn1.DERUTF8String = function(params) {
    -1303     KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);
    -1304     this.hT = "0c";
    -1305 };
    -1306 YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);
    -1307 
    -1308 // ********************************************************************
    -1309 /**
    -1310  * class for ASN.1 DER NumericString
    -1311  * @name KJUR.asn1.DERNumericString
    -1312  * @class class for ASN.1 DER NumericString
    -1313  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1314  * @extends KJUR.asn1.DERAbstractString
    -1315  * @description
    -1316  * @see KJUR.asn1.DERAbstractString - superclass
    -1317  */
    -1318 KJUR.asn1.DERNumericString = function(params) {
    -1319     KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);
    -1320     this.hT = "12";
    -1321 };
    -1322 YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);
    -1323 
    -1324 // ********************************************************************
    -1325 /**
    -1326  * class for ASN.1 DER PrintableString
    -1327  * @name KJUR.asn1.DERPrintableString
    -1328  * @class class for ASN.1 DER PrintableString
    -1329  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1330  * @extends KJUR.asn1.DERAbstractString
    -1331  * @description
    -1332  * @see KJUR.asn1.DERAbstractString - superclass
    -1333  */
    -1334 KJUR.asn1.DERPrintableString = function(params) {
    -1335     KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);
    -1336     this.hT = "13";
    -1337 };
    -1338 YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);
    -1339 
    -1340 // ********************************************************************
    -1341 /**
    -1342  * class for ASN.1 DER TeletexString
    -1343  * @name KJUR.asn1.DERTeletexString
    -1344  * @class class for ASN.1 DER TeletexString
    -1345  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1346  * @extends KJUR.asn1.DERAbstractString
    -1347  * @description
    -1348  * @see KJUR.asn1.DERAbstractString - superclass
    -1349  */
    -1350 KJUR.asn1.DERTeletexString = function(params) {
    -1351     KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);
    -1352     this.hT = "14";
    -1353 };
    -1354 YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);
    -1355 
    -1356 // ********************************************************************
    -1357 /**
    -1358  * class for ASN.1 DER IA5String
    -1359  * @name KJUR.asn1.DERIA5String
    -1360  * @class class for ASN.1 DER IA5String
    -1361  * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
    -1362  * @extends KJUR.asn1.DERAbstractString
    -1363  * @description
    -1364  * @see KJUR.asn1.DERAbstractString - superclass
    -1365  */
    -1366 KJUR.asn1.DERIA5String = function(params) {
    -1367     KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
    -1368     this.hT = "16";
    -1369 };
    -1370 YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);
    -1371 
    -1372 // ********************************************************************
    -1373 /**
    -1374  * class for ASN.1 DER UTCTime
    -1375  * @name KJUR.asn1.DERUTCTime
    -1376  * @class class for ASN.1 DER UTCTime
    -1377  * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
    -1378  * @extends KJUR.asn1.DERAbstractTime
    -1379  * @description
    -1380  * <br/>
    -1381  * As for argument 'params' for constructor, you can specify one of
    -1382  * following properties:
    -1383  * <ul>
    -1384  * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
    -1385  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1386  * <li>date - specify Date object.</li>
    -1387  * </ul>
    -1388  * NOTE: 'params' can be omitted.
    -1389  * <h4>EXAMPLES</h4>
    -1390  * @example
    -1391  * d1 = new KJUR.asn1.DERUTCTime();
    -1392  * d1.setString('130430125959Z');
    -1393  *
    -1394  * d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
    -1395  * d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
    -1396  * d4 = new KJUR.asn1.DERUTCTime('130430125959Z');
    -1397  */
    -1398 KJUR.asn1.DERUTCTime = function(params) {
    -1399     KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);
    -1400     this.hT = "17";
    -1401 
    -1402     /**
    -1403      * set value by a Date object<br/>
    -1404      * @name setByDate
    -1405      * @memberOf KJUR.asn1.DERUTCTime#
    -1406      * @function
    -1407      * @param {Date} dateObject Date object to set ASN.1 value(V)
    -1408      * @example
    -1409      * o = new KJUR.asn1.DERUTCTime();
    -1410      * o.setByDate(new Date("2016/12/31"));
    -1411      */
    -1412     this.setByDate = function(dateObject) {
    -1413         this.hTLV = null;
    -1414         this.isModified = true;
    -1415         this.date = dateObject;
    -1416         this.s = this.formatDate(this.date, 'utc');
    -1417         this.hV = stohex(this.s);
    -1418     };
    -1419 
    -1420     this.getFreshValueHex = function() {
    -1421         if (typeof this.date == "undefined" && typeof this.s == "undefined") {
    -1422             this.date = new Date();
    -1423             this.s = this.formatDate(this.date, 'utc');
    -1424             this.hV = stohex(this.s);
    -1425         }
    -1426         return this.hV;
    -1427     };
    -1428 
    -1429     if (params !== undefined) {
    -1430         if (params.str !== undefined) {
    -1431             this.setString(params.str);
    -1432         } else if (typeof params == "string" && params.match(/^[0-9]{12}Z$/)) {
    -1433             this.setString(params);
    -1434         } else if (params.hex !== undefined) {
    -1435             this.setStringHex(params.hex);
    -1436         } else if (params.date !== undefined) {
    -1437             this.setByDate(params.date);
    -1438         }
    -1439     }
    -1440 };
    -1441 YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);
    -1442 
    -1443 // ********************************************************************
    -1444 /**
    -1445  * class for ASN.1 DER GeneralizedTime
    -1446  * @name KJUR.asn1.DERGeneralizedTime
    -1447  * @class class for ASN.1 DER GeneralizedTime
    -1448  * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
    -1449  * @property {Boolean} withMillis flag to show milliseconds or not
    -1450  * @extends KJUR.asn1.DERAbstractTime
    -1451  * @description
    -1452  * <br/>
    -1453  * As for argument 'params' for constructor, you can specify one of
    -1454  * following properties:
    -1455  * <ul>
    -1456  * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
    -1457  * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
    -1458  * <li>date - specify Date object.</li>
    -1459  * <li>millis - specify flag to show milliseconds (from 1.0.6)</li>
    -1460  * </ul>
    -1461  * NOTE1: 'params' can be omitted.
    -1462  * NOTE2: 'withMillis' property is supported from asn1 1.0.6.
    -1463  */
    -1464 KJUR.asn1.DERGeneralizedTime = function(params) {
    -1465     KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);
    -1466     this.hT = "18";
    -1467     this.withMillis = false;
    -1468 
    -1469     /**
    -1470      * set value by a Date object
    -1471      * @name setByDate
    -1472      * @memberOf KJUR.asn1.DERGeneralizedTime#
    -1473      * @function
    -1474      * @param {Date} dateObject Date object to set ASN.1 value(V)
    -1475      * @example
    -1476      * When you specify UTC time, use 'Date.UTC' method like this:<br/>
    -1477      * o1 = new DERUTCTime();
    -1478      * o1.setByDate(date);
    -1479      *
    -1480      * date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59
    -1481      */
    -1482     this.setByDate = function(dateObject) {
    -1483         this.hTLV = null;
    -1484         this.isModified = true;
    -1485         this.date = dateObject;
    -1486         this.s = this.formatDate(this.date, 'gen', this.withMillis);
    -1487         this.hV = stohex(this.s);
    -1488     };
    -1489 
    -1490     this.getFreshValueHex = function() {
    -1491         if (this.date === undefined && this.s === undefined) {
    -1492             this.date = new Date();
    -1493             this.s = this.formatDate(this.date, 'gen', this.withMillis);
    -1494             this.hV = stohex(this.s);
    -1495         }
    -1496         return this.hV;
    -1497     };
    -1498 
    -1499     if (params !== undefined) {
    -1500         if (params.str !== undefined) {
    -1501             this.setString(params.str);
    -1502         } else if (typeof params == "string" && params.match(/^[0-9]{14}Z$/)) {
    -1503             this.setString(params);
    -1504         } else if (params.hex !== undefined) {
    -1505             this.setStringHex(params.hex);
    -1506         } else if (params.date !== undefined) {
    -1507             this.setByDate(params.date);
    -1508         }
    -1509         if (params.millis === true) {
    -1510             this.withMillis = true;
    -1511         }
    -1512     }
    -1513 };
    -1514 YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);
    -1515 
    -1516 // ********************************************************************
    -1517 /**
    -1518  * class for ASN.1 DER Sequence
    -1519  * @name KJUR.asn1.DERSequence
    -1520  * @class class for ASN.1 DER Sequence
    -1521  * @extends KJUR.asn1.DERAbstractStructured
    -1522  * @description
    -1523  * <br/>
    -1524  * As for argument 'params' for constructor, you can specify one of
    -1525  * following properties:
    -1526  * <ul>
    -1527  * <li>array - specify array of ASN1Object to set elements of content</li>
    -1528  * </ul>
    -1529  * NOTE: 'params' can be omitted.
    -1530  */
    -1531 KJUR.asn1.DERSequence = function(params) {
    -1532     KJUR.asn1.DERSequence.superclass.constructor.call(this, params);
    -1533     this.hT = "30";
    -1534     this.getFreshValueHex = function() {
    -1535         var h = '';
    -1536         for (var i = 0; i < this.asn1Array.length; i++) {
    -1537             var asn1Obj = this.asn1Array[i];
    -1538             h += asn1Obj.getEncodedHex();
    -1539         }
    -1540         this.hV = h;
    -1541         return this.hV;
    -1542     };
    -1543 };
    -1544 YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);
    -1545 
    -1546 // ********************************************************************
    -1547 /**
    -1548  * class for ASN.1 DER Set
    -1549  * @name KJUR.asn1.DERSet
    -1550  * @class class for ASN.1 DER Set
    -1551  * @extends KJUR.asn1.DERAbstractStructured
    -1552  * @description
    -1553  * <br/>
    -1554  * As for argument 'params' for constructor, you can specify one of
    -1555  * following properties:
    -1556  * <ul>
    -1557  * <li>array - specify array of ASN1Object to set elements of content</li>
    -1558  * <li>sortflag - flag for sort (default: true). ASN.1 BER is not sorted in 'SET OF'.</li>
    -1559  * </ul>
    -1560  * NOTE1: 'params' can be omitted.<br/>
    -1561  * NOTE2: sortflag is supported since 1.0.5.
    -1562  */
    -1563 KJUR.asn1.DERSet = function(params) {
    -1564     KJUR.asn1.DERSet.superclass.constructor.call(this, params);
    -1565     this.hT = "31";
    -1566     this.sortFlag = true; // item shall be sorted only in ASN.1 DER
    -1567     this.getFreshValueHex = function() {
    -1568         var a = new Array();
    -1569         for (var i = 0; i < this.asn1Array.length; i++) {
    -1570             var asn1Obj = this.asn1Array[i];
    -1571             a.push(asn1Obj.getEncodedHex());
    -1572         }
    -1573         if (this.sortFlag == true) a.sort();
    -1574         this.hV = a.join('');
    -1575         return this.hV;
    -1576     };
    -1577 
    -1578     if (typeof params != "undefined") {
    -1579         if (typeof params.sortflag != "undefined" &&
    -1580             params.sortflag == false)
    -1581             this.sortFlag = false;
    -1582     }
    -1583 };
    -1584 YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);
    -1585 
    -1586 // ********************************************************************
    -1587 /**
    -1588  * class for ASN.1 DER TaggedObject
    -1589  * @name KJUR.asn1.DERTaggedObject
    -1590  * @class class for ASN.1 DER TaggedObject
    -1591  * @extends KJUR.asn1.ASN1Object
    -1592  * @description
    -1593  * <br/>
    -1594  * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.
    -1595  * For example, if you find '[1]' tag in a ASN.1 dump, 
    -1596  * 'tagNoHex' will be 'a1'.
    -1597  * <br/>
    -1598  * As for optional argument 'params' for constructor, you can specify *ANY* of
    -1599  * following properties:
    -1600  * <ul>
    -1601  * <li>explicit - specify true if this is explicit tag otherwise false 
    -1602  *     (default is 'true').</li>
    -1603  * <li>tag - specify tag (default is 'a0' which means [0])</li>
    -1604  * <li>obj - specify ASN1Object which is tagged</li>
    -1605  * </ul>
    -1606  * @example
    -1607  * d1 = new KJUR.asn1.DERUTF8String({'str':'a'});
    -1608  * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});
    -1609  * hex = d2.getEncodedHex();
    -1610  */
    -1611 KJUR.asn1.DERTaggedObject = function(params) {
    -1612     KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);
    -1613     this.hT = "a0";
    -1614     this.hV = '';
    -1615     this.isExplicit = true;
    -1616     this.asn1Object = null;
    -1617 
    -1618     /**
    -1619      * set value by an ASN1Object
    -1620      * @name setString
    -1621      * @memberOf KJUR.asn1.DERTaggedObject#
    -1622      * @function
    -1623      * @param {Boolean} isExplicitFlag flag for explicit/implicit tag
    -1624      * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag
    -1625      * @param {ASN1Object} asn1Object ASN.1 to encapsulate
    -1626      */
    -1627     this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {
    -1628         this.hT = tagNoHex;
    -1629         this.isExplicit = isExplicitFlag;
    -1630         this.asn1Object = asn1Object;
    -1631         if (this.isExplicit) {
    -1632             this.hV = this.asn1Object.getEncodedHex();
    -1633             this.hTLV = null;
    -1634             this.isModified = true;
    -1635         } else {
    -1636             this.hV = null;
    -1637             this.hTLV = asn1Object.getEncodedHex();
    -1638             this.hTLV = this.hTLV.replace(/^../, tagNoHex);
    -1639             this.isModified = false;
    -1640         }
    -1641     };
    -1642 
    -1643     this.getFreshValueHex = function() {
    -1644         return this.hV;
    -1645     };
    -1646 
    -1647     if (typeof params != "undefined") {
    -1648         if (typeof params['tag'] != "undefined") {
    -1649             this.hT = params['tag'];
    -1650         }
    -1651         if (typeof params['explicit'] != "undefined") {
    -1652             this.isExplicit = params['explicit'];
    -1653         }
    -1654         if (typeof params['obj'] != "undefined") {
    -1655             this.asn1Object = params['obj'];
    -1656             this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);
    -1657         }
    -1658     }
    -1659 };
    -1660 YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
    -1661 
    \ No newline at end of file +1161
    var h = ''; +1162 var a = oidString.split('.'); +1163 var i0 = parseInt(a[0]) * 40 + parseInt(a[1]); +1164 h += itox(i0); +1165 a.splice(0, 2); +1166 for (var i = 0; i < a.length; i++) { +1167 h += roidtox(a[i]); +1168 } +1169 this.hTLV = null; +1170 this.isModified = true; +1171 this.s = null; +1172 this.hV = h; +1173 }; +1174 +1175 /** +1176 * set value by a OID name +1177 * @name setValueName +1178 * @memberOf KJUR.asn1.DERObjectIdentifier# +1179 * @function +1180 * @param {String} oidName OID name (ex. 'serverAuth') +1181 * @since 1.0.1 +1182 * @description +1183 * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'. +1184 * Otherwise raise error. +1185 * @example +1186 * o = new KJUR.asn1.DERObjectIdentifier(); +1187 * o.setValueName("serverAuth"); +1188 */ +1189 this.setValueName = function(oidName) { +1190 var oid = KJUR.asn1.x509.OID.name2oid(oidName); +1191 if (oid !== '') { +1192 this.setValueOidString(oid); +1193 } else { +1194 throw "DERObjectIdentifier oidName undefined: " + oidName; +1195 } +1196 }; +1197 +1198 this.getFreshValueHex = function() { +1199 return this.hV; +1200 }; +1201 +1202 if (params !== undefined) { +1203 if (typeof params === "string") { +1204 if (params.match(/^[0-2].[0-9.]+$/)) { +1205 this.setValueOidString(params); +1206 } else { +1207 this.setValueName(params); +1208 } +1209 } else if (params.oid !== undefined) { +1210 this.setValueOidString(params.oid); +1211 } else if (params.hex !== undefined) { +1212 this.setValueHex(params.hex); +1213 } else if (params.name !== undefined) { +1214 this.setValueName(params.name); +1215 } +1216 } +1217 }; +1218 YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object); +1219 +1220 // ******************************************************************** +1221 /** +1222 * class for ASN.1 DER Enumerated +1223 * @name KJUR.asn1.DEREnumerated +1224 * @class class for ASN.1 DER Enumerated +1225 * @extends KJUR.asn1.ASN1Object +1226 * @description +1227 * <br/> +1228 * As for argument 'params' for constructor, you can specify one of +1229 * following properties: +1230 * <ul> +1231 * <li>int - specify initial ASN.1 value(V) by integer value</li> +1232 * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li> +1233 * </ul> +1234 * NOTE: 'params' can be omitted. +1235 * @example +1236 * new KJUR.asn1.DEREnumerated(123); +1237 * new KJUR.asn1.DEREnumerated({int: 123}); +1238 * new KJUR.asn1.DEREnumerated({hex: '1fad'}); +1239 */ +1240 KJUR.asn1.DEREnumerated = function(params) { +1241 KJUR.asn1.DEREnumerated.superclass.constructor.call(this); +1242 this.hT = "0a"; +1243 +1244 /** +1245 * set value by Tom Wu's BigInteger object +1246 * @name setByBigInteger +1247 * @memberOf KJUR.asn1.DEREnumerated# +1248 * @function +1249 * @param {BigInteger} bigIntegerValue to set +1250 */ +1251 this.setByBigInteger = function(bigIntegerValue) { +1252 this.hTLV = null; +1253 this.isModified = true; +1254 this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue); +1255 }; +1256 +1257 /** +1258 * set value by integer value +1259 * @name setByInteger +1260 * @memberOf KJUR.asn1.DEREnumerated# +1261 * @function +1262 * @param {Integer} integer value to set +1263 */ +1264 this.setByInteger = function(intValue) { +1265 var bi = new BigInteger(String(intValue), 10); +1266 this.setByBigInteger(bi); +1267 }; +1268 +1269 /** +1270 * set value by integer value +1271 * @name setValueHex +1272 * @memberOf KJUR.asn1.DEREnumerated# +1273 * @function +1274 * @param {String} hexadecimal string of integer value +1275 * @description +1276 * <br/> +1277 * NOTE: Value shall be represented by minimum octet length of +1278 * two's complement representation. +1279 */ +1280 this.setValueHex = function(newHexString) { +1281 this.hV = newHexString; +1282 }; +1283 +1284 this.getFreshValueHex = function() { +1285 return this.hV; +1286 }; +1287 +1288 if (typeof params != "undefined") { +1289 if (typeof params['int'] != "undefined") { +1290 this.setByInteger(params['int']); +1291 } else if (typeof params == "number") { +1292 this.setByInteger(params); +1293 } else if (typeof params['hex'] != "undefined") { +1294 this.setValueHex(params['hex']); +1295 } +1296 } +1297 }; +1298 YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object); +1299 +1300 // ******************************************************************** +1301 /** +1302 * class for ASN.1 DER UTF8String +1303 * @name KJUR.asn1.DERUTF8String +1304 * @class class for ASN.1 DER UTF8String +1305 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1306 * @extends KJUR.asn1.DERAbstractString +1307 * @description +1308 * @see KJUR.asn1.DERAbstractString - superclass +1309 */ +1310 KJUR.asn1.DERUTF8String = function(params) { +1311 KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params); +1312 this.hT = "0c"; +1313 }; +1314 YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString); +1315 +1316 // ******************************************************************** +1317 /** +1318 * class for ASN.1 DER NumericString +1319 * @name KJUR.asn1.DERNumericString +1320 * @class class for ASN.1 DER NumericString +1321 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1322 * @extends KJUR.asn1.DERAbstractString +1323 * @description +1324 * @see KJUR.asn1.DERAbstractString - superclass +1325 */ +1326 KJUR.asn1.DERNumericString = function(params) { +1327 KJUR.asn1.DERNumericString.superclass.constructor.call(this, params); +1328 this.hT = "12"; +1329 }; +1330 YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString); +1331 +1332 // ******************************************************************** +1333 /** +1334 * class for ASN.1 DER PrintableString +1335 * @name KJUR.asn1.DERPrintableString +1336 * @class class for ASN.1 DER PrintableString +1337 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1338 * @extends KJUR.asn1.DERAbstractString +1339 * @description +1340 * @see KJUR.asn1.DERAbstractString - superclass +1341 */ +1342 KJUR.asn1.DERPrintableString = function(params) { +1343 KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params); +1344 this.hT = "13"; +1345 }; +1346 YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString); +1347 +1348 // ******************************************************************** +1349 /** +1350 * class for ASN.1 DER TeletexString +1351 * @name KJUR.asn1.DERTeletexString +1352 * @class class for ASN.1 DER TeletexString +1353 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1354 * @extends KJUR.asn1.DERAbstractString +1355 * @description +1356 * @see KJUR.asn1.DERAbstractString - superclass +1357 */ +1358 KJUR.asn1.DERTeletexString = function(params) { +1359 KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params); +1360 this.hT = "14"; +1361 }; +1362 YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString); +1363 +1364 // ******************************************************************** +1365 /** +1366 * class for ASN.1 DER IA5String +1367 * @name KJUR.asn1.DERIA5String +1368 * @class class for ASN.1 DER IA5String +1369 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1370 * @extends KJUR.asn1.DERAbstractString +1371 * @description +1372 * @see KJUR.asn1.DERAbstractString - superclass +1373 */ +1374 KJUR.asn1.DERIA5String = function(params) { +1375 KJUR.asn1.DERIA5String.superclass.constructor.call(this, params); +1376 this.hT = "16"; +1377 }; +1378 YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString); +1379 +1380 // ******************************************************************** +1381 /** +1382 * class for ASN.1 DER VisibleString +1383 * @name KJUR.asn1.DERVisibleString +1384 * @class class for ASN.1 DER VisibleString +1385 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1386 * @extends KJUR.asn1.DERAbstractString +1387 * @since jsrsasign 8.0.23 asn1 1.0.15 +1388 * @description +1389 * @see KJUR.asn1.DERAbstractString - superclass +1390 */ +1391 KJUR.asn1.DERVisibleString = function(params) { +1392 KJUR.asn1.DERIA5String.superclass.constructor.call(this, params); +1393 this.hT = "1a"; +1394 }; +1395 YAHOO.lang.extend(KJUR.asn1.DERVisibleString, KJUR.asn1.DERAbstractString); +1396 +1397 // ******************************************************************** +1398 /** +1399 * class for ASN.1 DER BMPString +1400 * @name KJUR.asn1.DERBMPString +1401 * @class class for ASN.1 DER BMPString +1402 * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) +1403 * @extends KJUR.asn1.DERAbstractString +1404 * @since jsrsasign 8.0.23 asn1 1.0.15 +1405 * @description +1406 * @see KJUR.asn1.DERAbstractString - superclass +1407 */ +1408 KJUR.asn1.DERBMPString = function(params) { +1409 KJUR.asn1.DERBMPString.superclass.constructor.call(this, params); +1410 this.hT = "1e"; +1411 }; +1412 YAHOO.lang.extend(KJUR.asn1.DERBMPString, KJUR.asn1.DERAbstractString); +1413 +1414 // ******************************************************************** +1415 /** +1416 * class for ASN.1 DER UTCTime +1417 * @name KJUR.asn1.DERUTCTime +1418 * @class class for ASN.1 DER UTCTime +1419 * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'}) +1420 * @extends KJUR.asn1.DERAbstractTime +1421 * @description +1422 * <br/> +1423 * As for argument 'params' for constructor, you can specify one of +1424 * following properties: +1425 * <ul> +1426 * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li> +1427 * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li> +1428 * <li>date - specify Date object.</li> +1429 * </ul> +1430 * NOTE: 'params' can be omitted. +1431 * <h4>EXAMPLES</h4> +1432 * @example +1433 * d1 = new KJUR.asn1.DERUTCTime(); +1434 * d1.setString('130430125959Z'); +1435 * +1436 * d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'}); +1437 * d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))}); +1438 * d4 = new KJUR.asn1.DERUTCTime('130430125959Z'); +1439 */ +1440 KJUR.asn1.DERUTCTime = function(params) { +1441 KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params); +1442 this.hT = "17"; +1443 +1444 /** +1445 * set value by a Date object<br/> +1446 * @name setByDate +1447 * @memberOf KJUR.asn1.DERUTCTime# +1448 * @function +1449 * @param {Date} dateObject Date object to set ASN.1 value(V) +1450 * @example +1451 * o = new KJUR.asn1.DERUTCTime(); +1452 * o.setByDate(new Date("2016/12/31")); +1453 */ +1454 this.setByDate = function(dateObject) { +1455 this.hTLV = null; +1456 this.isModified = true; +1457 this.date = dateObject; +1458 this.s = this.formatDate(this.date, 'utc'); +1459 this.hV = stohex(this.s); +1460 }; +1461 +1462 this.getFreshValueHex = function() { +1463 if (typeof this.date == "undefined" && typeof this.s == "undefined") { +1464 this.date = new Date(); +1465 this.s = this.formatDate(this.date, 'utc'); +1466 this.hV = stohex(this.s); +1467 } +1468 return this.hV; +1469 }; +1470 +1471 if (params !== undefined) { +1472 if (params.str !== undefined) { +1473 this.setString(params.str); +1474 } else if (typeof params == "string" && params.match(/^[0-9]{12}Z$/)) { +1475 this.setString(params); +1476 } else if (params.hex !== undefined) { +1477 this.setStringHex(params.hex); +1478 } else if (params.date !== undefined) { +1479 this.setByDate(params.date); +1480 } +1481 } +1482 }; +1483 YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime); +1484 +1485 // ******************************************************************** +1486 /** +1487 * class for ASN.1 DER GeneralizedTime +1488 * @name KJUR.asn1.DERGeneralizedTime +1489 * @class class for ASN.1 DER GeneralizedTime +1490 * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'}) +1491 * @property {Boolean} withMillis flag to show milliseconds or not +1492 * @extends KJUR.asn1.DERAbstractTime +1493 * @description +1494 * <br/> +1495 * As for argument 'params' for constructor, you can specify one of +1496 * following properties: +1497 * <ul> +1498 * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li> +1499 * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li> +1500 * <li>date - specify Date object.</li> +1501 * <li>millis - specify flag to show milliseconds (from 1.0.6)</li> +1502 * </ul> +1503 * NOTE1: 'params' can be omitted. +1504 * NOTE2: 'withMillis' property is supported from asn1 1.0.6. +1505 */ +1506 KJUR.asn1.DERGeneralizedTime = function(params) { +1507 KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params); +1508 this.hT = "18"; +1509 this.withMillis = false; +1510 +1511 /** +1512 * set value by a Date object +1513 * @name setByDate +1514 * @memberOf KJUR.asn1.DERGeneralizedTime# +1515 * @function +1516 * @param {Date} dateObject Date object to set ASN.1 value(V) +1517 * @example +1518 * When you specify UTC time, use 'Date.UTC' method like this:<br/> +1519 * o1 = new DERUTCTime(); +1520 * o1.setByDate(date); +1521 * +1522 * date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59 +1523 */ +1524 this.setByDate = function(dateObject) { +1525 this.hTLV = null; +1526 this.isModified = true; +1527 this.date = dateObject; +1528 this.s = this.formatDate(this.date, 'gen', this.withMillis); +1529 this.hV = stohex(this.s); +1530 }; +1531 +1532 this.getFreshValueHex = function() { +1533 if (this.date === undefined && this.s === undefined) { +1534 this.date = new Date(); +1535 this.s = this.formatDate(this.date, 'gen', this.withMillis); +1536 this.hV = stohex(this.s); +1537 } +1538 return this.hV; +1539 }; +1540 +1541 if (params !== undefined) { +1542 if (params.str !== undefined) { +1543 this.setString(params.str); +1544 } else if (typeof params == "string" && params.match(/^[0-9]{14}Z$/)) { +1545 this.setString(params); +1546 } else if (params.hex !== undefined) { +1547 this.setStringHex(params.hex); +1548 } else if (params.date !== undefined) { +1549 this.setByDate(params.date); +1550 } +1551 if (params.millis === true) { +1552 this.withMillis = true; +1553 } +1554 } +1555 }; +1556 YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime); +1557 +1558 // ******************************************************************** +1559 /** +1560 * class for ASN.1 DER Sequence +1561 * @name KJUR.asn1.DERSequence +1562 * @class class for ASN.1 DER Sequence +1563 * @extends KJUR.asn1.DERAbstractStructured +1564 * @description +1565 * <br/> +1566 * As for argument 'params' for constructor, you can specify one of +1567 * following properties: +1568 * <ul> +1569 * <li>array - specify array of ASN1Object to set elements of content</li> +1570 * </ul> +1571 * NOTE: 'params' can be omitted. +1572 */ +1573 KJUR.asn1.DERSequence = function(params) { +1574 KJUR.asn1.DERSequence.superclass.constructor.call(this, params); +1575 this.hT = "30"; +1576 this.getFreshValueHex = function() { +1577 var h = ''; +1578 for (var i = 0; i < this.asn1Array.length; i++) { +1579 var asn1Obj = this.asn1Array[i]; +1580 h += asn1Obj.getEncodedHex(); +1581 } +1582 this.hV = h; +1583 return this.hV; +1584 }; +1585 }; +1586 YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured); +1587 +1588 // ******************************************************************** +1589 /** +1590 * class for ASN.1 DER Set +1591 * @name KJUR.asn1.DERSet +1592 * @class class for ASN.1 DER Set +1593 * @extends KJUR.asn1.DERAbstractStructured +1594 * @description +1595 * <br/> +1596 * As for argument 'params' for constructor, you can specify one of +1597 * following properties: +1598 * <ul> +1599 * <li>array - specify array of ASN1Object to set elements of content</li> +1600 * <li>sortflag - flag for sort (default: true). ASN.1 BER is not sorted in 'SET OF'.</li> +1601 * </ul> +1602 * NOTE1: 'params' can be omitted.<br/> +1603 * NOTE2: sortflag is supported since 1.0.5. +1604 */ +1605 KJUR.asn1.DERSet = function(params) { +1606 KJUR.asn1.DERSet.superclass.constructor.call(this, params); +1607 this.hT = "31"; +1608 this.sortFlag = true; // item shall be sorted only in ASN.1 DER +1609 this.getFreshValueHex = function() { +1610 var a = new Array(); +1611 for (var i = 0; i < this.asn1Array.length; i++) { +1612 var asn1Obj = this.asn1Array[i]; +1613 a.push(asn1Obj.getEncodedHex()); +1614 } +1615 if (this.sortFlag == true) a.sort(); +1616 this.hV = a.join(''); +1617 return this.hV; +1618 }; +1619 +1620 if (typeof params != "undefined") { +1621 if (typeof params.sortflag != "undefined" && +1622 params.sortflag == false) +1623 this.sortFlag = false; +1624 } +1625 }; +1626 YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured); +1627 +1628 // ******************************************************************** +1629 /** +1630 * class for ASN.1 DER TaggedObject +1631 * @name KJUR.asn1.DERTaggedObject +1632 * @class class for ASN.1 DER TaggedObject +1633 * @extends KJUR.asn1.ASN1Object +1634 * @description +1635 * <br/> +1636 * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object. +1637 * For example, if you find '[1]' tag in a ASN.1 dump, +1638 * 'tagNoHex' will be 'a1'. +1639 * <br/> +1640 * As for optional argument 'params' for constructor, you can specify *ANY* of +1641 * following properties: +1642 * <ul> +1643 * <li>explicit - specify true if this is explicit tag otherwise false +1644 * (default is 'true').</li> +1645 * <li>tag - specify tag (default is 'a0' which means [0])</li> +1646 * <li>obj - specify ASN1Object which is tagged</li> +1647 * </ul> +1648 * @example +1649 * d1 = new KJUR.asn1.DERUTF8String({'str':'a'}); +1650 * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1}); +1651 * hex = d2.getEncodedHex(); +1652 */ +1653 KJUR.asn1.DERTaggedObject = function(params) { +1654 KJUR.asn1.DERTaggedObject.superclass.constructor.call(this); +1655 this.hT = "a0"; +1656 this.hV = ''; +1657 this.isExplicit = true; +1658 this.asn1Object = null; +1659 +1660 /** +1661 * set value by an ASN1Object +1662 * @name setString +1663 * @memberOf KJUR.asn1.DERTaggedObject# +1664 * @function +1665 * @param {Boolean} isExplicitFlag flag for explicit/implicit tag +1666 * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag +1667 * @param {ASN1Object} asn1Object ASN.1 to encapsulate +1668 */ +1669 this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) { +1670 this.hT = tagNoHex; +1671 this.isExplicit = isExplicitFlag; +1672 this.asn1Object = asn1Object; +1673 if (this.isExplicit) { +1674 this.hV = this.asn1Object.getEncodedHex(); +1675 this.hTLV = null; +1676 this.isModified = true; +1677 } else { +1678 this.hV = null; +1679 this.hTLV = asn1Object.getEncodedHex(); +1680 this.hTLV = this.hTLV.replace(/^../, tagNoHex); +1681 this.isModified = false; +1682 } +1683 }; +1684 +1685 this.getFreshValueHex = function() { +1686 return this.hV; +1687 }; +1688 +1689 if (typeof params != "undefined") { +1690 if (typeof params['tag'] != "undefined") { +1691 this.hT = params['tag']; +1692 } +1693 if (typeof params['explicit'] != "undefined") { +1694 this.isExplicit = params['explicit']; +1695 } +1696 if (typeof params['obj'] != "undefined") { +1697 this.asn1Object = params['obj']; +1698 this.setASN1Object(this.isExplicit, this.hT, this.asn1Object); +1699 } +1700 } +1701 }; +1702 YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object); +1703
    \ No newline at end of file diff --git a/api/symbols/src/asn1hex-1.1.js.html b/api/symbols/src/asn1hex-1.1.js.html index 64198180..8a78bd0e 100644 --- a/api/symbols/src/asn1hex-1.1.js.html +++ b/api/symbols/src/asn1hex-1.1.js.html @@ -722,346 +722,354 @@ 715 if (indent === undefined) indent = ""; 716 var skipLongHex = flags.ommit_long_octet; 717 -718 if (hex.substr(idx, 2) == "01") { -719 var v = _getV(hex, idx); -720 if (v == "00") { -721 return indent + "BOOLEAN FALSE\n"; -722 } else { -723 return indent + "BOOLEAN TRUE\n"; -724 } -725 } -726 if (hex.substr(idx, 2) == "02") { -727 var v = _getV(hex, idx); -728 return indent + "INTEGER " + _skipLongHex(v, skipLongHex) + "\n"; -729 } -730 if (hex.substr(idx, 2) == "03") { -731 var v = _getV(hex, idx); -732 if (_ASN1HEX.isASN1HEX(v.substr(2))) { -733 var s = indent + "BITSTRING, encapsulates\n"; -734 s = s + _dump(v.substr(2), flags, 0, indent + " "); -735 return s; -736 } else { -737 return indent + "BITSTRING " + _skipLongHex(v, skipLongHex) + "\n"; -738 } -739 } -740 if (hex.substr(idx, 2) == "04") { -741 var v = _getV(hex, idx); -742 if (_ASN1HEX.isASN1HEX(v)) { -743 var s = indent + "OCTETSTRING, encapsulates\n"; -744 s = s + _dump(v, flags, 0, indent + " "); -745 return s; -746 } else { -747 return indent + "OCTETSTRING " + _skipLongHex(v, skipLongHex) + "\n"; -748 } -749 } -750 if (hex.substr(idx, 2) == "05") { -751 return indent + "NULL\n"; -752 } -753 if (hex.substr(idx, 2) == "06") { -754 var hV = _getV(hex, idx); -755 var oidDot = KJUR.asn1.ASN1Util.oidHexToInt(hV); -756 var oidName = KJUR.asn1.x509.OID.oid2name(oidDot); -757 var oidSpc = oidDot.replace(/\./g, ' '); -758 if (oidName != '') { -759 return indent + "ObjectIdentifier " + oidName + " (" + oidSpc + ")\n"; -760 } else { -761 return indent + "ObjectIdentifier (" + oidSpc + ")\n"; -762 } -763 } -764 if (hex.substr(idx, 2) == "0c") { -765 return indent + "UTF8String '" + hextoutf8(_getV(hex, idx)) + "'\n"; -766 } -767 if (hex.substr(idx, 2) == "13") { -768 return indent + "PrintableString '" + hextoutf8(_getV(hex, idx)) + "'\n"; -769 } -770 if (hex.substr(idx, 2) == "14") { -771 return indent + "TeletexString '" + hextoutf8(_getV(hex, idx)) + "'\n"; -772 } -773 if (hex.substr(idx, 2) == "16") { -774 return indent + "IA5String '" + hextoutf8(_getV(hex, idx)) + "'\n"; -775 } -776 if (hex.substr(idx, 2) == "17") { -777 return indent + "UTCTime " + hextoutf8(_getV(hex, idx)) + "\n"; -778 } -779 if (hex.substr(idx, 2) == "18") { -780 return indent + "GeneralizedTime " + hextoutf8(_getV(hex, idx)) + "\n"; -781 } -782 if (hex.substr(idx, 2) == "30") { -783 if (hex.substr(idx, 4) == "3000") { -784 return indent + "SEQUENCE {}\n"; -785 } -786 -787 var s = indent + "SEQUENCE\n"; -788 var aIdx = _getChildIdx(hex, idx); -789 -790 var flagsTemp = flags; -791 -792 if ((aIdx.length == 2 || aIdx.length == 3) && -793 hex.substr(aIdx[0], 2) == "06" && -794 hex.substr(aIdx[aIdx.length - 1], 2) == "04") { // supposed X.509v3 extension -795 var oidName = _ASN1HEX.oidname(_getV(hex, aIdx[0])); -796 var flagsClone = JSON.parse(JSON.stringify(flags)); -797 flagsClone.x509ExtName = oidName; -798 flagsTemp = flagsClone; -799 } -800 -801 for (var i = 0; i < aIdx.length; i++) { -802 s = s + _dump(hex, flagsTemp, aIdx[i], indent + " "); -803 } -804 return s; -805 } -806 if (hex.substr(idx, 2) == "31") { -807 var s = indent + "SET\n"; -808 var aIdx = _getChildIdx(hex, idx); -809 for (var i = 0; i < aIdx.length; i++) { -810 s = s + _dump(hex, flags, aIdx[i], indent + " "); +718 var tag = hex.substr(idx, 2); +719 +720 if (tag == "01") { +721 var v = _getV(hex, idx); +722 if (v == "00") { +723 return indent + "BOOLEAN FALSE\n"; +724 } else { +725 return indent + "BOOLEAN TRUE\n"; +726 } +727 } +728 if (tag == "02") { +729 var v = _getV(hex, idx); +730 return indent + "INTEGER " + _skipLongHex(v, skipLongHex) + "\n"; +731 } +732 if (tag == "03") { +733 var v = _getV(hex, idx); +734 if (_ASN1HEX.isASN1HEX(v.substr(2))) { +735 var s = indent + "BITSTRING, encapsulates\n"; +736 s = s + _dump(v.substr(2), flags, 0, indent + " "); +737 return s; +738 } else { +739 return indent + "BITSTRING " + _skipLongHex(v, skipLongHex) + "\n"; +740 } +741 } +742 if (tag == "04") { +743 var v = _getV(hex, idx); +744 if (_ASN1HEX.isASN1HEX(v)) { +745 var s = indent + "OCTETSTRING, encapsulates\n"; +746 s = s + _dump(v, flags, 0, indent + " "); +747 return s; +748 } else { +749 return indent + "OCTETSTRING " + _skipLongHex(v, skipLongHex) + "\n"; +750 } +751 } +752 if (tag == "05") { +753 return indent + "NULL\n"; +754 } +755 if (tag == "06") { +756 var hV = _getV(hex, idx); +757 var oidDot = KJUR.asn1.ASN1Util.oidHexToInt(hV); +758 var oidName = KJUR.asn1.x509.OID.oid2name(oidDot); +759 var oidSpc = oidDot.replace(/\./g, ' '); +760 if (oidName != '') { +761 return indent + "ObjectIdentifier " + oidName + " (" + oidSpc + ")\n"; +762 } else { +763 return indent + "ObjectIdentifier (" + oidSpc + ")\n"; +764 } +765 } +766 if (tag == "0c") { +767 return indent + "UTF8String '" + hextoutf8(_getV(hex, idx)) + "'\n"; +768 } +769 if (tag == "13") { +770 return indent + "PrintableString '" + hextoutf8(_getV(hex, idx)) + "'\n"; +771 } +772 if (tag == "14") { +773 return indent + "TeletexString '" + hextoutf8(_getV(hex, idx)) + "'\n"; +774 } +775 if (tag == "16") { +776 return indent + "IA5String '" + hextoutf8(_getV(hex, idx)) + "'\n"; +777 } +778 if (tag == "17") { +779 return indent + "UTCTime " + hextoutf8(_getV(hex, idx)) + "\n"; +780 } +781 if (tag == "18") { +782 return indent + "GeneralizedTime " + hextoutf8(_getV(hex, idx)) + "\n"; +783 } +784 if (tag == "1a") { +785 return indent + "VisualString '" + hextoutf8(_getV(hex, idx)) + "'\n"; +786 } +787 if (tag == "1e") { +788 return indent + "BMPString '" + hextoutf8(_getV(hex, idx)) + "'\n"; +789 } +790 if (tag == "30") { +791 if (hex.substr(idx, 4) == "3000") { +792 return indent + "SEQUENCE {}\n"; +793 } +794 +795 var s = indent + "SEQUENCE\n"; +796 var aIdx = _getChildIdx(hex, idx); +797 +798 var flagsTemp = flags; +799 +800 if ((aIdx.length == 2 || aIdx.length == 3) && +801 hex.substr(aIdx[0], 2) == "06" && +802 hex.substr(aIdx[aIdx.length - 1], 2) == "04") { // supposed X.509v3 extension +803 var oidName = _ASN1HEX.oidname(_getV(hex, aIdx[0])); +804 var flagsClone = JSON.parse(JSON.stringify(flags)); +805 flagsClone.x509ExtName = oidName; +806 flagsTemp = flagsClone; +807 } +808 +809 for (var i = 0; i < aIdx.length; i++) { +810 s = s + _dump(hex, flagsTemp, aIdx[i], indent + " "); 811 } 812 return s; 813 } -814 var tag = parseInt(hex.substr(idx, 2), 16); -815 if ((tag & 128) != 0) { // context specific -816 var tagNumber = tag & 31; -817 if ((tag & 32) != 0) { // structured tag -818 var s = indent + "[" + tagNumber + "]\n"; -819 var aIdx = _getChildIdx(hex, idx); -820 for (var i = 0; i < aIdx.length; i++) { -821 s = s + _dump(hex, flags, aIdx[i], indent + " "); -822 } -823 return s; -824 } else { // primitive tag -825 var v = _getV(hex, idx); -826 if (v.substr(0, 8) == "68747470") { // http -827 v = hextoutf8(v); -828 } -829 if (flags.x509ExtName === "subjectAltName" && -830 tagNumber == 2) { -831 v = hextoutf8(v); -832 } -833 -834 var s = indent + "[" + tagNumber + "] " + v + "\n"; -835 return s; -836 } -837 } -838 return indent + "UNKNOWN(" + hex.substr(idx, 2) + ") " + -839 _getV(hex, idx) + "\n"; -840 }; -841 -842 /** -843 * check if a hexadecimal tag is a specified ASN.1 context specific tag -844 * @name isContextTag -845 * @memberOf ASN1HEX -846 * @function -847 * @param {hTag} hex string of a hexadecimal ASN.1 tag consists by two characters (e.x. "a0") -848 * @param {sTag} context specific tag in string represention (OPTION) (e.x. "[0]") -849 * @return {Boolean} true if hTag is a ASN.1 context specific tag specified by sTag value. -850 * @since jsrsasign 8.0.21 asn1hex 1.2.2 -851 * @description -852 * This method checks if a hexadecimal tag is a specified ASN.1 context specific tag. -853 * Structured and non-structured type of tag have the same string representation -854 * of context specific tag. For example tag "a0" and "80" have the same string -855 * representation "[0]". -856 * The sTag has a range from from "[0]" to "[31]". -857 * @example -858 * ASN1HEX.isContextTag('a0', '[0]') → true // structured -859 * ASN1HEX.isContextTag('a1', '[1]') → true // structured -860 * ASN1HEX.isContextTag('a2', '[2]') → true // structured -861 * ASN1HEX.isContextTag('80', '[0]') → true // non structured -862 * ASN1HEX.isContextTag('81', '[1]') → true // non structured -863 * ASN1HEX.isContextTag('82', '[2]') → true // non structured -864 * ASN1HEX.isContextTag('a0', '[3]') → false -865 * ASN1HEX.isContextTag('80', '[15]') → false -866 * -867 * ASN.1 tag bits -868 * 12345679 -869 * ++ tag class(universal:00, context specific:10) -870 * + structured:1, primitive:0 -871 * +++++ tag number (0 - 31) -872 */ -873 ASN1HEX.isContextTag = function(hTag, sTag) { -874 hTag = hTag.toLowerCase(); -875 var ihtag, istag; -876 -877 try { -878 ihtag = parseInt(hTag, 16); -879 } catch (ex) { -880 return -1; -881 } -882 -883 if (sTag === undefined) { -884 if ((ihtag & 192) == 128) { -885 return true; -886 } else { -887 return false; -888 } +814 if (tag == "31") { +815 var s = indent + "SET\n"; +816 var aIdx = _getChildIdx(hex, idx); +817 for (var i = 0; i < aIdx.length; i++) { +818 s = s + _dump(hex, flags, aIdx[i], indent + " "); +819 } +820 return s; +821 } +822 var tag = parseInt(tag, 16); +823 if ((tag & 128) != 0) { // context specific +824 var tagNumber = tag & 31; +825 if ((tag & 32) != 0) { // structured tag +826 var s = indent + "[" + tagNumber + "]\n"; +827 var aIdx = _getChildIdx(hex, idx); +828 for (var i = 0; i < aIdx.length; i++) { +829 s = s + _dump(hex, flags, aIdx[i], indent + " "); +830 } +831 return s; +832 } else { // primitive tag +833 var v = _getV(hex, idx); +834 if (v.substr(0, 8) == "68747470") { // http +835 v = hextoutf8(v); +836 } +837 if (flags.x509ExtName === "subjectAltName" && +838 tagNumber == 2) { +839 v = hextoutf8(v); +840 } +841 +842 var s = indent + "[" + tagNumber + "] " + v + "\n"; +843 return s; +844 } +845 } +846 return indent + "UNKNOWN(" + tag + ") " + +847 _getV(hex, idx) + "\n"; +848 }; +849 +850 /** +851 * check if a hexadecimal tag is a specified ASN.1 context specific tag +852 * @name isContextTag +853 * @memberOf ASN1HEX +854 * @function +855 * @param {hTag} hex string of a hexadecimal ASN.1 tag consists by two characters (e.x. "a0") +856 * @param {sTag} context specific tag in string represention (OPTION) (e.x. "[0]") +857 * @return {Boolean} true if hTag is a ASN.1 context specific tag specified by sTag value. +858 * @since jsrsasign 8.0.21 asn1hex 1.2.2 +859 * @description +860 * This method checks if a hexadecimal tag is a specified ASN.1 context specific tag. +861 * Structured and non-structured type of tag have the same string representation +862 * of context specific tag. For example tag "a0" and "80" have the same string +863 * representation "[0]". +864 * The sTag has a range from from "[0]" to "[31]". +865 * @example +866 * ASN1HEX.isContextTag('a0', '[0]') → true // structured +867 * ASN1HEX.isContextTag('a1', '[1]') → true // structured +868 * ASN1HEX.isContextTag('a2', '[2]') → true // structured +869 * ASN1HEX.isContextTag('80', '[0]') → true // non structured +870 * ASN1HEX.isContextTag('81', '[1]') → true // non structured +871 * ASN1HEX.isContextTag('82', '[2]') → true // non structured +872 * ASN1HEX.isContextTag('a0', '[3]') → false +873 * ASN1HEX.isContextTag('80', '[15]') → false +874 * +875 * ASN.1 tag bits +876 * 12345679 +877 * ++ tag class(universal:00, context specific:10) +878 * + structured:1, primitive:0 +879 * +++++ tag number (0 - 31) +880 */ +881 ASN1HEX.isContextTag = function(hTag, sTag) { +882 hTag = hTag.toLowerCase(); +883 var ihtag, istag; +884 +885 try { +886 ihtag = parseInt(hTag, 16); +887 } catch (ex) { +888 return -1; 889 } -890 -891 try { -892 var result = sTag.match(/^\[[0-9]+\]$/); -893 if (result == null) return false; -894 istag = parseInt(sTag.substr(1,sTag.length - 1), 10); -895 if (istag > 31) return false; -896 if (((ihtag & 192) == 128) && // ihtag & b11000000 == b10000000 -897 ((ihtag & 31) == istag)) { // ihtag & b00011111 == istag (0-31) -898 return true; -899 } -900 return false; -901 } catch (ex) { -902 return false; -903 } -904 }; -905 -906 /** -907 * simple ASN.1 DER hexadecimal string checker -908 * @name isASN1HEX -909 * @memberOf ASN1HEX -910 * @function -911 * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not -912 * @return {Boolean} true if it is hexadecimal string of ASN.1 data otherwise false -913 * @since jsrsasign 4.8.3 asn1hex 1.1.6 -914 * @description -915 * This method checks wheather the argument 'hex' is a hexadecimal string of -916 * ASN.1 data or not. -917 * @example -918 * ASN1HEX.isASN1HEX('0203012345') → true // PROPER ASN.1 INTEGER -919 * ASN1HEX.isASN1HEX('0203012345ff') → false // TOO LONG VALUE -920 * ASN1HEX.isASN1HEX('02030123') → false // TOO SHORT VALUE -921 * ASN1HEX.isASN1HEX('fa3bcd') → false // WRONG FOR ASN.1 -922 */ -923 ASN1HEX.isASN1HEX = function(hex) { -924 var _ASN1HEX = ASN1HEX; -925 if (hex.length % 2 == 1) return false; -926 -927 var intL = _ASN1HEX.getVblen(hex, 0); -928 var hT = hex.substr(0, 2); -929 var hL = _ASN1HEX.getL(hex, 0); -930 var hVLength = hex.length - hT.length - hL.length; -931 if (hVLength == intL * 2) return true; -932 -933 return false; -934 }; -935 -936 /** -937 * strict ASN.1 DER hexadecimal string checker -938 * @name checkStrictDER -939 * @memberOf ASN1HEX -940 * @function -941 * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not -942 * @return unspecified -943 * @since jsrsasign 8.0.19 asn1hex 1.2.1 -944 * @throws Error when malformed ASN.1 DER hexadecimal string -945 * @description -946 * This method checks wheather the argument 'hex' is a hexadecimal string of -947 * ASN.1 data or not. If the argument is not DER string, this -948 * raise an exception. -949 * @example -950 * ASN1HEX.checkStrictDER('0203012345') → NO EXCEPTION FOR PROPER ASN.1 INTEGER -951 * ASN1HEX.checkStrictDER('0203012345ff') → RAISE EXCEPTION FOR TOO LONG VALUE -952 * ASN1HEX.checkStrictDER('02030123') → false RAISE EXCEPITON FOR TOO SHORT VALUE -953 * ASN1HEX.checkStrictDER('fa3bcd') → false RAISE EXCEPTION FOR WRONG ASN.1 -954 */ -955 ASN1HEX.checkStrictDER = function(h, idx, maxHexLen, maxByteLen, maxLbyteLen) { -956 var _ASN1HEX = ASN1HEX; -957 -958 if (maxHexLen === undefined) { -959 // 1. hex string check -960 if (typeof h != "string") throw new Error("not hex string"); -961 h = h.toLowerCase(); -962 if (! KJUR.lang.String.isHex(h)) throw new Error("not hex string"); -963 -964 // 2. set max if needed -965 // max length of hexadecimal string -966 maxHexLen = h.length; -967 // max length of octets -968 maxByteLen = h.length / 2; -969 // max length of L octets of TLV -970 if (maxByteLen < 0x80) { -971 maxLbyteLen = 1; -972 } else { -973 maxLbyteLen = Math.ceil(maxByteLen.toString(16)) + 1; -974 } -975 } -976 //console.log(maxHexLen + ":" + maxByteLen + ":" + maxLbyteLen); -977 -978 // 3. check if L(length) string not exceeds maxLbyteLen -979 var hL = _ASN1HEX.getL(h, idx); -980 if (hL.length > maxLbyteLen * 2) -981 throw new Error("L of TLV too long: idx=" + idx); -982 -983 // 4. check if V(value) octet length (i.e. L(length) value) -984 // not exceeds maxByteLen -985 var vblen = _ASN1HEX.getVblen(h, idx); -986 if (vblen > maxByteLen) -987 throw new Error("value of L too long than hex: idx=" + idx); -988 -989 // 5. check V string length and L's value are the same -990 var hTLV = _ASN1HEX.getTLV(h, idx); -991 var hVLength = -992 hTLV.length - 2 - _ASN1HEX.getL(h, idx).length; -993 if (hVLength !== (vblen * 2)) -994 throw new Error("V string length and L's value not the same:" + -995 hVLength + "/" + (vblen * 2)); +890 +891 if (sTag === undefined) { +892 if ((ihtag & 192) == 128) { +893 return true; +894 } else { +895 return false; +896 } +897 } +898 +899 try { +900 var result = sTag.match(/^\[[0-9]+\]$/); +901 if (result == null) return false; +902 istag = parseInt(sTag.substr(1,sTag.length - 1), 10); +903 if (istag > 31) return false; +904 if (((ihtag & 192) == 128) && // ihtag & b11000000 == b10000000 +905 ((ihtag & 31) == istag)) { // ihtag & b00011111 == istag (0-31) +906 return true; +907 } +908 return false; +909 } catch (ex) { +910 return false; +911 } +912 }; +913 +914 /** +915 * simple ASN.1 DER hexadecimal string checker +916 * @name isASN1HEX +917 * @memberOf ASN1HEX +918 * @function +919 * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not +920 * @return {Boolean} true if it is hexadecimal string of ASN.1 data otherwise false +921 * @since jsrsasign 4.8.3 asn1hex 1.1.6 +922 * @description +923 * This method checks wheather the argument 'hex' is a hexadecimal string of +924 * ASN.1 data or not. +925 * @example +926 * ASN1HEX.isASN1HEX('0203012345') → true // PROPER ASN.1 INTEGER +927 * ASN1HEX.isASN1HEX('0203012345ff') → false // TOO LONG VALUE +928 * ASN1HEX.isASN1HEX('02030123') → false // TOO SHORT VALUE +929 * ASN1HEX.isASN1HEX('fa3bcd') → false // WRONG FOR ASN.1 +930 */ +931 ASN1HEX.isASN1HEX = function(hex) { +932 var _ASN1HEX = ASN1HEX; +933 if (hex.length % 2 == 1) return false; +934 +935 var intL = _ASN1HEX.getVblen(hex, 0); +936 var hT = hex.substr(0, 2); +937 var hL = _ASN1HEX.getL(hex, 0); +938 var hVLength = hex.length - hT.length - hL.length; +939 if (hVLength == intL * 2) return true; +940 +941 return false; +942 }; +943 +944 /** +945 * strict ASN.1 DER hexadecimal string checker +946 * @name checkStrictDER +947 * @memberOf ASN1HEX +948 * @function +949 * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not +950 * @return unspecified +951 * @since jsrsasign 8.0.19 asn1hex 1.2.1 +952 * @throws Error when malformed ASN.1 DER hexadecimal string +953 * @description +954 * This method checks wheather the argument 'hex' is a hexadecimal string of +955 * ASN.1 data or not. If the argument is not DER string, this +956 * raise an exception. +957 * @example +958 * ASN1HEX.checkStrictDER('0203012345') → NO EXCEPTION FOR PROPER ASN.1 INTEGER +959 * ASN1HEX.checkStrictDER('0203012345ff') → RAISE EXCEPTION FOR TOO LONG VALUE +960 * ASN1HEX.checkStrictDER('02030123') → false RAISE EXCEPITON FOR TOO SHORT VALUE +961 * ASN1HEX.checkStrictDER('fa3bcd') → false RAISE EXCEPTION FOR WRONG ASN.1 +962 */ +963 ASN1HEX.checkStrictDER = function(h, idx, maxHexLen, maxByteLen, maxLbyteLen) { +964 var _ASN1HEX = ASN1HEX; +965 +966 if (maxHexLen === undefined) { +967 // 1. hex string check +968 if (typeof h != "string") throw new Error("not hex string"); +969 h = h.toLowerCase(); +970 if (! KJUR.lang.String.isHex(h)) throw new Error("not hex string"); +971 +972 // 2. set max if needed +973 // max length of hexadecimal string +974 maxHexLen = h.length; +975 // max length of octets +976 maxByteLen = h.length / 2; +977 // max length of L octets of TLV +978 if (maxByteLen < 0x80) { +979 maxLbyteLen = 1; +980 } else { +981 maxLbyteLen = Math.ceil(maxByteLen.toString(16)) + 1; +982 } +983 } +984 //console.log(maxHexLen + ":" + maxByteLen + ":" + maxLbyteLen); +985 +986 // 3. check if L(length) string not exceeds maxLbyteLen +987 var hL = _ASN1HEX.getL(h, idx); +988 if (hL.length > maxLbyteLen * 2) +989 throw new Error("L of TLV too long: idx=" + idx); +990 +991 // 4. check if V(value) octet length (i.e. L(length) value) +992 // not exceeds maxByteLen +993 var vblen = _ASN1HEX.getVblen(h, idx); +994 if (vblen > maxByteLen) +995 throw new Error("value of L too long than hex: idx=" + idx); 996 -997 // 6. check appending garbled string -998 if (idx === 0) { -999 if (h.length != hTLV.length) -1000 throw new Error("total length and TLV length unmatch:" + -1001 h.length + "!=" + hTLV.length); -1002 } -1003 -1004 // 7. check if there isn't prepending zeros in DER INTEGER value -1005 var hT = h.substr(idx, 2); -1006 if (hT === '02') { -1007 var vidx = _ASN1HEX.getVidx(h, idx); -1008 // check if DER INTEGER VALUE have least leading zeros -1009 // for two's complement -1010 // GOOD - 3fabde... 008fad... -1011 // BAD - 000012... 007fad... -1012 if (h.substr(vidx, 2) == "00" && h.charCodeAt(vidx + 2) < 56) // '8'=56 -1013 throw new Error("not least zeros for DER INTEGER"); -1014 } -1015 -1016 // 8. check if all of elements in a structured item are conformed to -1017 // strict DER encoding rules. -1018 if (parseInt(hT, 16) & 32) { // structured tag? -1019 var intL = _ASN1HEX.getVblen(h, idx); -1020 var sum = 0; -1021 var aIdx = _ASN1HEX.getChildIdx(h, idx); -1022 for (var i = 0; i < aIdx.length; i++) { -1023 var tlv = _ASN1HEX.getTLV(h, aIdx[i]); -1024 sum += tlv.length; -1025 _ASN1HEX.checkStrictDER(h, aIdx[i], -1026 maxHexLen, maxByteLen, maxLbyteLen); -1027 } -1028 if ((intL * 2) != sum) -1029 throw new Error("sum of children's TLV length and L unmatch: " + -1030 (intL * 2) + "!=" + sum); -1031 } -1032 }; -1033 -1034 /** -1035 * get hexacedimal string from PEM format data<br/> -1036 * @name oidname -1037 * @memberOf ASN1HEX -1038 * @function -1039 * @param {String} oidDotOrHex number dot notation(i.e. 1.2.3) or hexadecimal string for OID -1040 * @return {String} name for OID -1041 * @since jsrsasign 7.2.0 asn1hex 1.1.11 -1042 * @description -1043 * This static method gets a OID name for -1044 * a specified string of number dot notation (i.e. 1.2.3) or -1045 * hexadecimal string. -1046 * @example -1047 * ASN1HEX.oidname("2.5.29.37") → extKeyUsage -1048 * ASN1HEX.oidname("551d25") → extKeyUsage -1049 * ASN1HEX.oidname("0.1.2.3") → 0.1.2.3 // unknown -1050 */ -1051 ASN1HEX.oidname = function(oidDotOrHex) { -1052 var _KJUR_asn1 = KJUR.asn1; -1053 if (KJUR.lang.String.isHex(oidDotOrHex)) -1054 oidDotOrHex = _KJUR_asn1.ASN1Util.oidHexToInt(oidDotOrHex); -1055 var name = _KJUR_asn1.x509.OID.oid2name(oidDotOrHex); -1056 if (name === "") name = oidDotOrHex; -1057 return name; -1058 }; -1059 -1060 \ No newline at end of file +997 // 5. check V string length and L's value are the same +998 var hTLV = _ASN1HEX.getTLV(h, idx); +999 var hVLength = +1000 hTLV.length - 2 - _ASN1HEX.getL(h, idx).length; +1001 if (hVLength !== (vblen * 2)) +1002 throw new Error("V string length and L's value not the same:" + +1003 hVLength + "/" + (vblen * 2)); +1004 +1005 // 6. check appending garbled string +1006 if (idx === 0) { +1007 if (h.length != hTLV.length) +1008 throw new Error("total length and TLV length unmatch:" + +1009 h.length + "!=" + hTLV.length); +1010 } +1011 +1012 // 7. check if there isn't prepending zeros in DER INTEGER value +1013 var hT = h.substr(idx, 2); +1014 if (hT === '02') { +1015 var vidx = _ASN1HEX.getVidx(h, idx); +1016 // check if DER INTEGER VALUE have least leading zeros +1017 // for two's complement +1018 // GOOD - 3fabde... 008fad... +1019 // BAD - 000012... 007fad... +1020 if (h.substr(vidx, 2) == "00" && h.charCodeAt(vidx + 2) < 56) // '8'=56 +1021 throw new Error("not least zeros for DER INTEGER"); +1022 } +1023 +1024 // 8. check if all of elements in a structured item are conformed to +1025 // strict DER encoding rules. +1026 if (parseInt(hT, 16) & 32) { // structured tag? +1027 var intL = _ASN1HEX.getVblen(h, idx); +1028 var sum = 0; +1029 var aIdx = _ASN1HEX.getChildIdx(h, idx); +1030 for (var i = 0; i < aIdx.length; i++) { +1031 var tlv = _ASN1HEX.getTLV(h, aIdx[i]); +1032 sum += tlv.length; +1033 _ASN1HEX.checkStrictDER(h, aIdx[i], +1034 maxHexLen, maxByteLen, maxLbyteLen); +1035 } +1036 if ((intL * 2) != sum) +1037 throw new Error("sum of children's TLV length and L unmatch: " + +1038 (intL * 2) + "!=" + sum); +1039 } +1040 }; +1041 +1042 /** +1043 * get hexacedimal string from PEM format data<br/> +1044 * @name oidname +1045 * @memberOf ASN1HEX +1046 * @function +1047 * @param {String} oidDotOrHex number dot notation(i.e. 1.2.3) or hexadecimal string for OID +1048 * @return {String} name for OID +1049 * @since jsrsasign 7.2.0 asn1hex 1.1.11 +1050 * @description +1051 * This static method gets a OID name for +1052 * a specified string of number dot notation (i.e. 1.2.3) or +1053 * hexadecimal string. +1054 * @example +1055 * ASN1HEX.oidname("2.5.29.37") → extKeyUsage +1056 * ASN1HEX.oidname("551d25") → extKeyUsage +1057 * ASN1HEX.oidname("0.1.2.3") → 0.1.2.3 // unknown +1058 */ +1059 ASN1HEX.oidname = function(oidDotOrHex) { +1060 var _KJUR_asn1 = KJUR.asn1; +1061 if (KJUR.lang.String.isHex(oidDotOrHex)) +1062 oidDotOrHex = _KJUR_asn1.ASN1Util.oidHexToInt(oidDotOrHex); +1063 var name = _KJUR_asn1.x509.OID.oid2name(oidDotOrHex); +1064 if (name === "") name = oidDotOrHex; +1065 return name; +1066 }; +1067 +1068 \ 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 bda153ea..d80d4baf 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-1.1.11.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
    +	
      1 /* asn1x509-1.1.12.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 8.0.21 asn1x509 1.1.11 (2020-Jul-28)
    + 19  * @version jsrsasign 8.0.23 asn1x509 1.1.12 (2020-Apr-06)
      20  * @since jsrsasign 2.1
      21  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
      22  */
    @@ -77,3184 +77,3580 @@
      70  * <li>{@link KJUR.asn1.x509.BasicConstraints}</li>
      71  * <li>{@link KJUR.asn1.x509.KeyUsage}</li>
      72  * <li>{@link KJUR.asn1.x509.CRLDistributionPoints}</li>
    - 73  * <li>{@link KJUR.asn1.x509.ExtKeyUsage}</li>
    - 74  * <li>{@link KJUR.asn1.x509.AuthorityKeyIdentifier}</li>
    - 75  * <li>{@link KJUR.asn1.x509.SubjectKeyIdentifier}</li>
    - 76  * <li>{@link KJUR.asn1.x509.AuthorityInfoAccess}</li>
    - 77  * <li>{@link KJUR.asn1.x509.SubjectAltName}</li>
    - 78  * <li>{@link KJUR.asn1.x509.IssuerAltName}</li>
    - 79  * </ul>
    - 80  * NOTE1: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.<br/>
    - 81  * NOTE2: SubjectAltName and IssuerAltName extension were supported since 
    - 82  * jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    - 83  * @name KJUR.asn1.x509
    - 84  * @namespace
    - 85  */
    - 86 if (typeof KJUR.asn1.x509 == "undefined" || !KJUR.asn1.x509) KJUR.asn1.x509 = {};
    - 87 
    - 88 // === BEGIN Certificate ===================================================
    - 89 
    - 90 /**
    - 91  * X.509 Certificate class to sign and generate hex encoded certificate
    - 92  * @name KJUR.asn1.x509.Certificate
    - 93  * @class X.509 Certificate class to sign and generate hex encoded certificate
    - 94  * @param {Array} params associative array of parameters (ex. {'tbscertobj': obj, 'prvkeyobj': key})
    - 95  * @extends KJUR.asn1.ASN1Object
    - 96  * @description
    - 97  * <br/>
    - 98  * As for argument 'params' for constructor, you can specify one of
    - 99  * following properties:
    -100  * <ul>
    -101  * <li>tbscertobj - specify {@link KJUR.asn1.x509.TBSCertificate} object</li>
    -102  * <li>prvkeyobj - specify {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object for CA private key to sign the certificate</li>
    -103  * </ul>
    -104  * NOTE1: 'params' can be omitted.<br/>
    -105  * NOTE2: DSA/ECDSA is also supported for CA signging key from asn1x509 1.0.6.
    -106  * @example
    -107  * var caKey = KEYUTIL.getKey(caKeyPEM); // CA's private key
    -108  * var cert = new KJUR.asn1x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': caKey});
    -109  * cert.sign(); // issue certificate by CA's private key
    -110  * var certPEM = cert.getPEMString();
    -111  *
    -112  * // Certificate  ::=  SEQUENCE  {
    -113  * //     tbsCertificate       TBSCertificate,
    -114  * //     signatureAlgorithm   AlgorithmIdentifier,
    -115  * //     signature            BIT STRING  }
    -116  */
    -117 KJUR.asn1.x509.Certificate = function(params) {
    -118     KJUR.asn1.x509.Certificate.superclass.constructor.call(this);
    -119     var asn1TBSCert = null,
    -120 	asn1SignatureAlg = null,
    -121 	asn1Sig = null,
    -122 	hexSig = null,
    -123         prvKey = null,
    -124 	_KJUR = KJUR,
    -125 	_KJUR_crypto = _KJUR.crypto,
    -126 	_KJUR_asn1 = _KJUR.asn1,
    -127 	_DERSequence = _KJUR_asn1.DERSequence,
    -128 	_DERBitString = _KJUR_asn1.DERBitString;
    -129 
    -130     /**
    -131      * sign TBSCertificate and set signature value internally
    -132      * @name sign
    -133      * @memberOf KJUR.asn1.x509.Certificate#
    -134      * @function
    -135      * @description
    -136      * @example
    -137      * var cert = new KJUR.asn1.x509.Certificate({tbscertobj: tbs, prvkeyobj: prvKey});
    -138      * cert.sign();
    -139      */
    -140     this.sign = function() {
    -141         this.asn1SignatureAlg = this.asn1TBSCert.asn1SignatureAlg;
    -142 	
    -143         var sig = new KJUR.crypto.Signature({alg: this.asn1SignatureAlg.nameAlg});
    -144         sig.init(this.prvKey);
    -145         sig.updateHex(this.asn1TBSCert.getEncodedHex());
    -146         this.hexSig = sig.sign();
    -147 
    -148         this.asn1Sig = new _DERBitString({'hex': '00' + this.hexSig});
    -149 
    -150         var seq = new _DERSequence({'array': [this.asn1TBSCert,
    -151                                               this.asn1SignatureAlg,
    -152                                               this.asn1Sig]});
    -153         this.hTLV = seq.getEncodedHex();
    -154         this.isModified = false;
    -155     };
    -156 
    -157     /**
    -158      * set signature value internally by hex string
    -159      * @name setSignatureHex
    -160      * @memberOf KJUR.asn1.x509.Certificate#
    -161      * @function
    -162      * @since asn1x509 1.0.8
    -163      * @description
    -164      * @example
    -165      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs});
    -166      * cert.setSignatureHex('01020304');
    -167      */
    -168     this.setSignatureHex = function(sigHex) {
    -169         this.asn1SignatureAlg = this.asn1TBSCert.asn1SignatureAlg;
    -170         this.hexSig = sigHex;
    -171         this.asn1Sig = new _DERBitString({'hex': '00' + this.hexSig});
    -172 
    -173         var seq = new _DERSequence({'array': [this.asn1TBSCert,
    -174                                               this.asn1SignatureAlg,
    -175                                               this.asn1Sig]});
    -176         this.hTLV = seq.getEncodedHex();
    -177         this.isModified = false;
    -178     };
    -179 
    -180     this.getEncodedHex = function() {
    -181         if (this.isModified == false && this.hTLV != null) return this.hTLV;
    -182         throw "not signed yet";
    -183     };
    -184 
    -185     /**
    -186      * get PEM formatted certificate string after signed
    -187      * @name getPEMString
    -188      * @memberOf KJUR.asn1.x509.Certificate#
    -189      * @function
    -190      * @return PEM formatted string of certificate
    -191      * @description
    -192      * @example
    -193      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': prvKey});
    -194      * cert.sign();
    -195      * var sPEM = cert.getPEMString();
    -196      */
    -197     this.getPEMString = function() {
    -198 	var pemBody = hextob64nl(this.getEncodedHex());
    -199         return "-----BEGIN CERTIFICATE-----\r\n" + 
    -200 	    pemBody + 
    -201 	    "\r\n-----END CERTIFICATE-----\r\n";
    -202     };
    -203 
    -204     if (params !== undefined) {
    -205         if (params.tbscertobj !== undefined) {
    -206             this.asn1TBSCert = params.tbscertobj;
    -207         }
    -208         if (params.prvkeyobj !== undefined) {
    -209             this.prvKey = params.prvkeyobj;
    -210         }
    -211     }
    -212 };
    -213 YAHOO.lang.extend(KJUR.asn1.x509.Certificate, KJUR.asn1.ASN1Object);
    -214 
    -215 /**
    -216  * ASN.1 TBSCertificate structure class
    -217  * @name KJUR.asn1.x509.TBSCertificate
    -218  * @class ASN.1 TBSCertificate structure class
    -219  * @param {Array} params associative array of parameters (ex. {})
    -220  * @extends KJUR.asn1.ASN1Object
    -221  * @description
    -222  * <br/>
    -223  * <h4>EXAMPLE</h4>
    -224  * @example
    -225  *  var o = new KJUR.asn1.x509.TBSCertificate();
    -226  *  o.setSerialNumberByParam({'int': 4});
    -227  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    -228  *  o.setIssuerByParam({'str': '/C=US/O=a'});
    -229  *  o.setNotBeforeByParam({'str': '130504235959Z'});
    -230  *  o.setNotAfterByParam({'str': '140504235959Z'});
    -231  *  o.setSubjectByParam({'str': '/C=US/CN=b'});
    -232  *  o.setSubjectPublicKey(rsaPubKey);
    -233  *  o.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true}));
    -234  *  o.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
    -235  */
    -236 KJUR.asn1.x509.TBSCertificate = function(params) {
    -237     KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this);
    -238 
    -239     var _KJUR = KJUR,
    -240 	_KJUR_asn1 = _KJUR.asn1,
    -241 	_DERSequence = _KJUR_asn1.DERSequence,
    -242 	_DERInteger = _KJUR_asn1.DERInteger,
    -243 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -244 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -245 	_Time = _KJUR_asn1_x509.Time,
    -246 	_X500Name = _KJUR_asn1_x509.X500Name,
    -247 	_SubjectPublicKeyInfo = _KJUR_asn1_x509.SubjectPublicKeyInfo;
    -248 
    -249     this._initialize = function() {
    -250         this.asn1Array = new Array();
    -251 
    -252         this.asn1Version =
    -253             new _DERTaggedObject({'obj': new _DERInteger({'int': 2})});
    -254         this.asn1SerialNumber = null;
    -255         this.asn1SignatureAlg = null;
    -256         this.asn1Issuer = null;
    -257         this.asn1NotBefore = null;
    -258         this.asn1NotAfter = null;
    -259         this.asn1Subject = null;
    -260         this.asn1SubjPKey = null;
    -261         this.extensionsArray = new Array();
    -262     };
    -263 
    -264     /**
    -265      * set serial number field by parameter
    -266      * @name setSerialNumberByParam
    -267      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -268      * @function
    -269      * @param {Array} intParam DERInteger param
    -270      * @description
    -271      * @example
    -272      * tbsc.setSerialNumberByParam({'int': 3});
    -273      */
    -274     this.setSerialNumberByParam = function(intParam) {
    -275         this.asn1SerialNumber = new _DERInteger(intParam);
    -276     };
    -277 
    -278     /**
    -279      * set signature algorithm field by parameter
    -280      * @name setSignatureAlgByParam
    -281      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -282      * @function
    -283      * @param {Array} algIdParam AlgorithmIdentifier parameter
    -284      * @see {@link KJUR.asn1.x509.AlgorithmIdentifier}
    -285      * @description
    -286      * @example
    -287      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    -288      */
    -289     this.setSignatureAlgByParam = function(algIdParam) {
    -290         this.asn1SignatureAlg = new _KJUR_asn1_x509.AlgorithmIdentifier(algIdParam);
    -291     };
    -292 
    -293     /**
    -294      * set issuer name field by parameter
    -295      * @name setIssuerByParam
    -296      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -297      * @function
    -298      * @param {Array} x500NameParam X500Name parameter
    -299      * @description
    -300      * @example
    -301      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
    -302      * @see KJUR.asn1.x509.X500Name
    -303      */
    -304     this.setIssuerByParam = function(x500NameParam) {
    -305         this.asn1Issuer = new _X500Name(x500NameParam);
    -306     };
    -307 
    -308     /**
    -309      * set notBefore field by parameter
    -310      * @name setNotBeforeByParam
    -311      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -312      * @function
    -313      * @param {Array} timeParam Time parameter
    -314      * @description
    -315      * @example
    -316      * tbsc.setNotBeforeByParam({'str': '130508235959Z'});
    -317      * @see KJUR.asn1.x509.Time
    -318      */
    -319     this.setNotBeforeByParam = function(timeParam) {
    -320         this.asn1NotBefore = new _Time(timeParam);
    -321     };
    -322 
    -323     /**
    -324      * set notAfter field by parameter
    -325      * @name setNotAfterByParam
    -326      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -327      * @function
    -328      * @param {Array} timeParam Time parameter
    -329      * @description
    -330      * @example
    -331      * tbsc.setNotAfterByParam({'str': '130508235959Z'});
    -332      * @see KJUR.asn1.x509.Time
    -333      */
    -334     this.setNotAfterByParam = function(timeParam) {
    -335         this.asn1NotAfter = new _Time(timeParam);
    -336     };
    -337 
    -338     /**
    -339      * set subject name field by parameter
    -340      * @name setSubjectByParam
    -341      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -342      * @function
    -343      * @param {Array} x500NameParam X500Name parameter
    -344      * @description
    -345      * @example
    -346      * tbsc.setSubjectParam({'str': '/C=US/CN=b'});
    -347      * @see KJUR.asn1.x509.X500Name
    -348      */
    -349     this.setSubjectByParam = function(x500NameParam) {
    -350         this.asn1Subject = new _X500Name(x500NameParam);
    -351     };
    -352 
    -353     /**
    -354      * set subject public key info field by key object
    -355      * @name setSubjectPublicKey
    -356      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -357      * @function
    -358      * @param {Array} param {@link KJUR.asn1.x509.SubjectPublicKeyInfo} class constructor parameter
    -359      * @description
    -360      * @example
    -361      * tbsc.setSubjectPublicKey(keyobj);
    -362      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
    -363      */
    -364     this.setSubjectPublicKey = function(param) {
    -365         this.asn1SubjPKey = new _SubjectPublicKeyInfo(param);
    -366     };
    -367 
    -368     /**
    -369      * set subject public key info by RSA/ECDSA/DSA key parameter
    -370      * @name setSubjectPublicKeyByGetKey
    -371      * @memberOf KJUR.asn1.x509.TBSCertificate
    -372      * @function
    -373      * @param {Object} keyParam public key parameter which passed to {@link KEYUTIL.getKey} argument
    -374      * @description
    -375      * @example
    -376      * tbsc.setSubjectPublicKeyByGetKeyParam(certPEMString); // or
    -377      * tbsc.setSubjectPublicKeyByGetKeyParam(pkcs8PublicKeyPEMString); // or
    -378      * tbsc.setSubjectPublicKeyByGetKeyParam(kjurCryptoECDSAKeyObject); // et.al.
    -379      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
    -380      * @see KEYUTIL.getKey
    -381      * @since asn1x509 1.0.6
    -382      */
    -383     this.setSubjectPublicKeyByGetKey = function(keyParam) {
    -384         var keyObj = KEYUTIL.getKey(keyParam);
    -385         this.asn1SubjPKey = new _SubjectPublicKeyInfo(keyObj);
    -386     };
    -387 
    -388     /**
    -389      * append X.509v3 extension to this object
    -390      * @name appendExtension
    -391      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -392      * @function
    -393      * @param {Extension} extObj X.509v3 Extension object
    -394      * @description
    -395      * @example
    -396      * tbsc.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true, 'critical': true}));
    -397      * tbsc.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
    -398      * @see KJUR.asn1.x509.Extension
    -399      */
    -400     this.appendExtension = function(extObj) {
    -401         this.extensionsArray.push(extObj);
    -402     };
    -403 
    -404     /**
    -405      * append X.509v3 extension to this object by name and parameters
    -406      * @name appendExtensionByName
    -407      * @memberOf KJUR.asn1.x509.TBSCertificate#
    -408      * @function
    -409      * @param {name} name name of X.509v3 Extension object
    -410      * @param {Array} extParams parameters as argument of Extension constructor.
    -411      * @description
    -412      * This method adds a X.509v3 extension specified by name 
    -413      * and extParams to internal extension array of X.509v3 extension objects.
    -414      * Here is supported names of extension:
    -415      * <ul>
    -416      * <li>BasicConstraints - {@link KJUR.asn1.x509.BasicConstraints}</li>
    -417      * <li>KeyUsage - {@link KJUR.asn1.x509.KeyUsage}</li>
    -418      * <li>CRLDistributionPoints - {@link KJUR.asn1.x509.CRLDistributionPoints}</li>
    -419      * <li>ExtKeyUsage - {@link KJUR.asn1.x509.ExtKeyUsage}</li>
    -420      * <li>AuthorityKeyIdentifier - {@link KJUR.asn1.x509.AuthorityKeyIdentifier}</li>
    -421      * <li>SubjectKeyIdentifier - {@link KJUR.asn1.x509.SubjectKeyIdentifier}</li>
    -422      * <li>AuthorityInfoAccess - {@link KJUR.asn1.x509.AuthorityInfoAccess}</li>
    -423      * <li>SubjectAltName - {@link KJUR.asn1.x509.SubjectAltName}</li>
    -424      * <li>IssuerAltName - {@link KJUR.asn1.x509.IssuerAltName}</li>
    -425      * </ul>
    -426      * @example
    -427      * var o = new KJUR.asn1.x509.TBSCertificate();
    -428      * o.appendExtensionByName('BasicConstraints', {'cA':true, 'critical': true});
    -429      * o.appendExtensionByName('KeyUsage', {'bin':'11'});
    -430      * o.appendExtensionByName('CRLDistributionPoints', {uri: 'http://aaa.com/a.crl'});
    -431      * o.appendExtensionByName('ExtKeyUsage', {array: [{name: 'clientAuth'}]});
    -432      * o.appendExtensionByName('AuthorityKeyIdentifier', {kid: '1234ab..'});
    -433      * o.appendExtensionByName('SubjectKeyIdentifier', {kid: '1234ab..'});
    -434      * o.appendExtensionByName('AuthorityInfoAccess', {array: [{accessMethod:{oid:...},accessLocation:{uri:...}}]});
    -435      * @see KJUR.asn1.x509.Extension
    -436      */
    -437     this.appendExtensionByName = function(name, extParams) {
    -438 	KJUR.asn1.x509.Extension.appendByNameToArray(name,
    -439 						     extParams,
    -440 						     this.extensionsArray);
    -441     };
    -442 
    -443     this.getEncodedHex = function() {
    -444         if (this.asn1NotBefore == null || this.asn1NotAfter == null)
    -445             throw "notBefore and/or notAfter not set";
    -446         var asn1Validity =
    -447             new _DERSequence({'array':[this.asn1NotBefore, this.asn1NotAfter]});
    + 73  * <li>{@link KJUR.asn1.x509.CertificatePolicies}</li>
    + 74  * <li>{@link KJUR.asn1.x509.ExtKeyUsage}</li>
    + 75  * <li>{@link KJUR.asn1.x509.AuthorityKeyIdentifier}</li>
    + 76  * <li>{@link KJUR.asn1.x509.SubjectKeyIdentifier}</li>
    + 77  * <li>{@link KJUR.asn1.x509.AuthorityInfoAccess}</li>
    + 78  * <li>{@link KJUR.asn1.x509.SubjectAltName}</li>
    + 79  * <li>{@link KJUR.asn1.x509.IssuerAltName}</li>
    + 80  * <li>{@link KJUR.asn1.x509.CertificatePolicies}</li>
    + 81  * </ul>
    + 82  * NOTE1: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.<br/>
    + 83  * NOTE2: SubjectAltName and IssuerAltName supported since 
    + 84  * jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    + 85  * NOTE3: CeritifcatePolicies supported supported since
    + 86  * jsrsasign 8.0.23 asn1x509 1.1.12<br/>
    + 87  * @name KJUR.asn1.x509
    + 88  * @namespace
    + 89  */
    + 90 if (typeof KJUR.asn1.x509 == "undefined" || !KJUR.asn1.x509) KJUR.asn1.x509 = {};
    + 91 
    + 92 // === BEGIN Certificate ===================================================
    + 93 
    + 94 /**
    + 95  * X.509 Certificate class to sign and generate hex encoded certificate
    + 96  * @name KJUR.asn1.x509.Certificate
    + 97  * @class X.509 Certificate class to sign and generate hex encoded certificate
    + 98  * @param {Array} params associative array of parameters (ex. {'tbscertobj': obj, 'prvkeyobj': key})
    + 99  * @extends KJUR.asn1.ASN1Object
    +100  * @description
    +101  * <br/>
    +102  * As for argument 'params' for constructor, you can specify one of
    +103  * following properties:
    +104  * <ul>
    +105  * <li>tbscertobj - specify {@link KJUR.asn1.x509.TBSCertificate} object</li>
    +106  * <li>prvkeyobj - specify {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object for CA private key to sign the certificate</li>
    +107  * </ul>
    +108  * NOTE1: 'params' can be omitted.<br/>
    +109  * NOTE2: DSA/ECDSA is also supported for CA signging key from asn1x509 1.0.6.
    +110  * @example
    +111  * var caKey = KEYUTIL.getKey(caKeyPEM); // CA's private key
    +112  * var cert = new KJUR.asn1x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': caKey});
    +113  * cert.sign(); // issue certificate by CA's private key
    +114  * var certPEM = cert.getPEMString();
    +115  *
    +116  * // Certificate  ::=  SEQUENCE  {
    +117  * //     tbsCertificate       TBSCertificate,
    +118  * //     signatureAlgorithm   AlgorithmIdentifier,
    +119  * //     signature            BIT STRING  }
    +120  */
    +121 KJUR.asn1.x509.Certificate = function(params) {
    +122     KJUR.asn1.x509.Certificate.superclass.constructor.call(this);
    +123     var asn1TBSCert = null,
    +124 	asn1SignatureAlg = null,
    +125 	asn1Sig = null,
    +126 	hexSig = null,
    +127         prvKey = null,
    +128 	_KJUR = KJUR,
    +129 	_KJUR_crypto = _KJUR.crypto,
    +130 	_KJUR_asn1 = _KJUR.asn1,
    +131 	_DERSequence = _KJUR_asn1.DERSequence,
    +132 	_DERBitString = _KJUR_asn1.DERBitString;
    +133 
    +134     /**
    +135      * sign TBSCertificate and set signature value internally
    +136      * @name sign
    +137      * @memberOf KJUR.asn1.x509.Certificate#
    +138      * @function
    +139      * @description
    +140      * @example
    +141      * var cert = new KJUR.asn1.x509.Certificate({tbscertobj: tbs, prvkeyobj: prvKey});
    +142      * cert.sign();
    +143      */
    +144     this.sign = function() {
    +145         this.asn1SignatureAlg = this.asn1TBSCert.asn1SignatureAlg;
    +146 	
    +147         var sig = new KJUR.crypto.Signature({alg: this.asn1SignatureAlg.nameAlg});
    +148         sig.init(this.prvKey);
    +149         sig.updateHex(this.asn1TBSCert.getEncodedHex());
    +150         this.hexSig = sig.sign();
    +151 
    +152         this.asn1Sig = new _DERBitString({'hex': '00' + this.hexSig});
    +153 
    +154         var seq = new _DERSequence({'array': [this.asn1TBSCert,
    +155                                               this.asn1SignatureAlg,
    +156                                               this.asn1Sig]});
    +157         this.hTLV = seq.getEncodedHex();
    +158         this.isModified = false;
    +159     };
    +160 
    +161     /**
    +162      * set signature value internally by hex string
    +163      * @name setSignatureHex
    +164      * @memberOf KJUR.asn1.x509.Certificate#
    +165      * @function
    +166      * @since asn1x509 1.0.8
    +167      * @description
    +168      * @example
    +169      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs});
    +170      * cert.setSignatureHex('01020304');
    +171      */
    +172     this.setSignatureHex = function(sigHex) {
    +173         this.asn1SignatureAlg = this.asn1TBSCert.asn1SignatureAlg;
    +174         this.hexSig = sigHex;
    +175         this.asn1Sig = new _DERBitString({'hex': '00' + this.hexSig});
    +176 
    +177         var seq = new _DERSequence({'array': [this.asn1TBSCert,
    +178                                               this.asn1SignatureAlg,
    +179                                               this.asn1Sig]});
    +180         this.hTLV = seq.getEncodedHex();
    +181         this.isModified = false;
    +182     };
    +183 
    +184     this.getEncodedHex = function() {
    +185         if (this.isModified == false && this.hTLV != null) return this.hTLV;
    +186         throw "not signed yet";
    +187     };
    +188 
    +189     /**
    +190      * get PEM formatted certificate string after signed
    +191      * @name getPEMString
    +192      * @memberOf KJUR.asn1.x509.Certificate#
    +193      * @function
    +194      * @return PEM formatted string of certificate
    +195      * @description
    +196      * @example
    +197      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': prvKey});
    +198      * cert.sign();
    +199      * var sPEM = cert.getPEMString();
    +200      */
    +201     this.getPEMString = function() {
    +202 	var pemBody = hextob64nl(this.getEncodedHex());
    +203         return "-----BEGIN CERTIFICATE-----\r\n" + 
    +204 	    pemBody + 
    +205 	    "\r\n-----END CERTIFICATE-----\r\n";
    +206     };
    +207 
    +208     if (params !== undefined) {
    +209         if (params.tbscertobj !== undefined) {
    +210             this.asn1TBSCert = params.tbscertobj;
    +211         }
    +212         if (params.prvkeyobj !== undefined) {
    +213             this.prvKey = params.prvkeyobj;
    +214         }
    +215     }
    +216 };
    +217 YAHOO.lang.extend(KJUR.asn1.x509.Certificate, KJUR.asn1.ASN1Object);
    +218 
    +219 /**
    +220  * ASN.1 TBSCertificate structure class
    +221  * @name KJUR.asn1.x509.TBSCertificate
    +222  * @class ASN.1 TBSCertificate structure class
    +223  * @param {Array} params associative array of parameters (ex. {})
    +224  * @extends KJUR.asn1.ASN1Object
    +225  * @description
    +226  * <br/>
    +227  * <h4>EXAMPLE</h4>
    +228  * @example
    +229  *  var o = new KJUR.asn1.x509.TBSCertificate();
    +230  *  o.setSerialNumberByParam({'int': 4});
    +231  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    +232  *  o.setIssuerByParam({'str': '/C=US/O=a'});
    +233  *  o.setNotBeforeByParam({'str': '130504235959Z'});
    +234  *  o.setNotAfterByParam({'str': '140504235959Z'});
    +235  *  o.setSubjectByParam({'str': '/C=US/CN=b'});
    +236  *  o.setSubjectPublicKey(rsaPubKey);
    +237  *  o.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true}));
    +238  *  o.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
    +239  */
    +240 KJUR.asn1.x509.TBSCertificate = function(params) {
    +241     KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this);
    +242 
    +243     var _KJUR = KJUR,
    +244 	_KJUR_asn1 = _KJUR.asn1,
    +245 	_DERSequence = _KJUR_asn1.DERSequence,
    +246 	_DERInteger = _KJUR_asn1.DERInteger,
    +247 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +248 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +249 	_Time = _KJUR_asn1_x509.Time,
    +250 	_X500Name = _KJUR_asn1_x509.X500Name,
    +251 	_SubjectPublicKeyInfo = _KJUR_asn1_x509.SubjectPublicKeyInfo;
    +252 
    +253     this._initialize = function() {
    +254         this.asn1Array = new Array();
    +255 
    +256         this.asn1Version =
    +257             new _DERTaggedObject({'obj': new _DERInteger({'int': 2})});
    +258         this.asn1SerialNumber = null;
    +259         this.asn1SignatureAlg = null;
    +260         this.asn1Issuer = null;
    +261         this.asn1NotBefore = null;
    +262         this.asn1NotAfter = null;
    +263         this.asn1Subject = null;
    +264         this.asn1SubjPKey = null;
    +265         this.extensionsArray = new Array();
    +266     };
    +267 
    +268     /**
    +269      * set serial number field by parameter
    +270      * @name setSerialNumberByParam
    +271      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +272      * @function
    +273      * @param {Array} intParam DERInteger param
    +274      * @description
    +275      * @example
    +276      * tbsc.setSerialNumberByParam({'int': 3});
    +277      */
    +278     this.setSerialNumberByParam = function(intParam) {
    +279         this.asn1SerialNumber = new _DERInteger(intParam);
    +280     };
    +281 
    +282     /**
    +283      * set signature algorithm field by parameter
    +284      * @name setSignatureAlgByParam
    +285      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +286      * @function
    +287      * @param {Array} algIdParam AlgorithmIdentifier parameter
    +288      * @see {@link KJUR.asn1.x509.AlgorithmIdentifier}
    +289      * @description
    +290      * @example
    +291      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    +292      */
    +293     this.setSignatureAlgByParam = function(algIdParam) {
    +294         this.asn1SignatureAlg = new _KJUR_asn1_x509.AlgorithmIdentifier(algIdParam);
    +295     };
    +296 
    +297     /**
    +298      * set issuer name field by parameter
    +299      * @name setIssuerByParam
    +300      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +301      * @function
    +302      * @param {Array} x500NameParam X500Name parameter
    +303      * @description
    +304      * @example
    +305      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
    +306      * @see KJUR.asn1.x509.X500Name
    +307      */
    +308     this.setIssuerByParam = function(x500NameParam) {
    +309         this.asn1Issuer = new _X500Name(x500NameParam);
    +310     };
    +311 
    +312     /**
    +313      * set notBefore field by parameter
    +314      * @name setNotBeforeByParam
    +315      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +316      * @function
    +317      * @param {Array} timeParam Time parameter
    +318      * @description
    +319      * @example
    +320      * tbsc.setNotBeforeByParam({'str': '130508235959Z'});
    +321      * @see KJUR.asn1.x509.Time
    +322      */
    +323     this.setNotBeforeByParam = function(timeParam) {
    +324         this.asn1NotBefore = new _Time(timeParam);
    +325     };
    +326 
    +327     /**
    +328      * set notAfter field by parameter
    +329      * @name setNotAfterByParam
    +330      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +331      * @function
    +332      * @param {Array} timeParam Time parameter
    +333      * @description
    +334      * @example
    +335      * tbsc.setNotAfterByParam({'str': '130508235959Z'});
    +336      * @see KJUR.asn1.x509.Time
    +337      */
    +338     this.setNotAfterByParam = function(timeParam) {
    +339         this.asn1NotAfter = new _Time(timeParam);
    +340     };
    +341 
    +342     /**
    +343      * set subject name field by parameter
    +344      * @name setSubjectByParam
    +345      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +346      * @function
    +347      * @param {Array} x500NameParam X500Name parameter
    +348      * @description
    +349      * @example
    +350      * tbsc.setSubjectParam({'str': '/C=US/CN=b'});
    +351      * @see KJUR.asn1.x509.X500Name
    +352      */
    +353     this.setSubjectByParam = function(x500NameParam) {
    +354         this.asn1Subject = new _X500Name(x500NameParam);
    +355     };
    +356 
    +357     /**
    +358      * set subject public key info field by key object
    +359      * @name setSubjectPublicKey
    +360      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +361      * @function
    +362      * @param {Array} param {@link KJUR.asn1.x509.SubjectPublicKeyInfo} class constructor parameter
    +363      * @description
    +364      * @example
    +365      * tbsc.setSubjectPublicKey(keyobj);
    +366      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
    +367      */
    +368     this.setSubjectPublicKey = function(param) {
    +369         this.asn1SubjPKey = new _SubjectPublicKeyInfo(param);
    +370     };
    +371 
    +372     /**
    +373      * set subject public key info by RSA/ECDSA/DSA key parameter
    +374      * @name setSubjectPublicKeyByGetKey
    +375      * @memberOf KJUR.asn1.x509.TBSCertificate
    +376      * @function
    +377      * @param {Object} keyParam public key parameter which passed to {@link KEYUTIL.getKey} argument
    +378      * @description
    +379      * @example
    +380      * tbsc.setSubjectPublicKeyByGetKeyParam(certPEMString); // or
    +381      * tbsc.setSubjectPublicKeyByGetKeyParam(pkcs8PublicKeyPEMString); // or
    +382      * tbsc.setSubjectPublicKeyByGetKeyParam(kjurCryptoECDSAKeyObject); // et.al.
    +383      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
    +384      * @see KEYUTIL.getKey
    +385      * @since asn1x509 1.0.6
    +386      */
    +387     this.setSubjectPublicKeyByGetKey = function(keyParam) {
    +388         var keyObj = KEYUTIL.getKey(keyParam);
    +389         this.asn1SubjPKey = new _SubjectPublicKeyInfo(keyObj);
    +390     };
    +391 
    +392     /**
    +393      * append X.509v3 extension to this object
    +394      * @name appendExtension
    +395      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +396      * @function
    +397      * @param {Extension} extObj X.509v3 Extension object
    +398      * @description
    +399      * @example
    +400      * tbsc.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true, 'critical': true}));
    +401      * tbsc.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
    +402      * @see KJUR.asn1.x509.Extension
    +403      */
    +404     this.appendExtension = function(extObj) {
    +405         this.extensionsArray.push(extObj);
    +406     };
    +407 
    +408     /**
    +409      * append X.509v3 extension to this object by name and parameters
    +410      * @name appendExtensionByName
    +411      * @memberOf KJUR.asn1.x509.TBSCertificate#
    +412      * @function
    +413      * @param {name} name name of X.509v3 Extension object
    +414      * @param {Array} extParams parameters as argument of Extension constructor.
    +415      * @description
    +416      * This method adds a X.509v3 extension specified by name 
    +417      * and extParams to internal extension array of X.509v3 extension objects.
    +418      * Here is supported names of extension:
    +419      * <ul>
    +420      * <li>BasicConstraints - {@link KJUR.asn1.x509.BasicConstraints}</li>
    +421      * <li>KeyUsage - {@link KJUR.asn1.x509.KeyUsage}</li>
    +422      * <li>CRLDistributionPoints - {@link KJUR.asn1.x509.CRLDistributionPoints}</li>
    +423      * <li>CertificatePolicies - {@link KJUR.asn1.x509.CertificatePolicies}</li>
    +424      * <li>ExtKeyUsage - {@link KJUR.asn1.x509.ExtKeyUsage}</li>
    +425      * <li>AuthorityKeyIdentifier - {@link KJUR.asn1.x509.AuthorityKeyIdentifier}</li>
    +426      * <li>SubjectKeyIdentifier - {@link KJUR.asn1.x509.SubjectKeyIdentifier}</li>
    +427      * <li>AuthorityInfoAccess - {@link KJUR.asn1.x509.AuthorityInfoAccess}</li>
    +428      * <li>SubjectAltName - {@link KJUR.asn1.x509.SubjectAltName}</li>
    +429      * <li>IssuerAltName - {@link KJUR.asn1.x509.IssuerAltName}</li>
    +430      * <li>CertificatePolicies - {@link KJUR.asn1.x509.CertificatePolicies}</li>
    +431      * </ul>
    +432      * @example
    +433      * var o = new KJUR.asn1.x509.TBSCertificate();
    +434      * o.appendExtensionByName('BasicConstraints', {'cA':true, 'critical': true});
    +435      * o.appendExtensionByName('KeyUsage', {'bin':'11'});
    +436      * o.appendExtensionByName('CRLDistributionPoints', {uri: 'http://aaa.com/a.crl'});
    +437      * o.appendExtensionByName('ExtKeyUsage', {array: [{name: 'clientAuth'}]});
    +438      * o.appendExtensionByName('AuthorityKeyIdentifier', {kid: '1234ab..'});
    +439      * o.appendExtensionByName('SubjectKeyIdentifier', {kid: '1234ab..'});
    +440      * o.appendExtensionByName('AuthorityInfoAccess', {array: [{accessMethod:{oid:...},accessLocation:{uri:...}}]});
    +441      * @see KJUR.asn1.x509.Extension
    +442      */
    +443     this.appendExtensionByName = function(name, extParams) {
    +444 	KJUR.asn1.x509.Extension.appendByNameToArray(name,
    +445 						     extParams,
    +446 						     this.extensionsArray);
    +447     };
     448 
    -449         this.asn1Array = new Array();
    -450 
    -451         this.asn1Array.push(this.asn1Version);
    -452         this.asn1Array.push(this.asn1SerialNumber);
    -453         this.asn1Array.push(this.asn1SignatureAlg);
    -454         this.asn1Array.push(this.asn1Issuer);
    -455         this.asn1Array.push(asn1Validity);
    -456         this.asn1Array.push(this.asn1Subject);
    -457         this.asn1Array.push(this.asn1SubjPKey);
    -458 
    -459         if (this.extensionsArray.length > 0) {
    -460             var extSeq = new _DERSequence({"array": this.extensionsArray});
    -461             var extTagObj = new _DERTaggedObject({'explicit': true,
    -462                                                   'tag': 'a3',
    -463                                                   'obj': extSeq});
    -464             this.asn1Array.push(extTagObj);
    -465         }
    -466 
    -467         var o = new _DERSequence({"array": this.asn1Array});
    -468         this.hTLV = o.getEncodedHex();
    -469         this.isModified = false;
    -470         return this.hTLV;
    -471     };
    +449     this.getEncodedHex = function() {
    +450         if (this.asn1NotBefore == null || this.asn1NotAfter == null)
    +451             throw "notBefore and/or notAfter not set";
    +452         var asn1Validity =
    +453             new _DERSequence({'array':[this.asn1NotBefore, this.asn1NotAfter]});
    +454 
    +455         this.asn1Array = new Array();
    +456 
    +457         this.asn1Array.push(this.asn1Version);
    +458         this.asn1Array.push(this.asn1SerialNumber);
    +459         this.asn1Array.push(this.asn1SignatureAlg);
    +460         this.asn1Array.push(this.asn1Issuer);
    +461         this.asn1Array.push(asn1Validity);
    +462         this.asn1Array.push(this.asn1Subject);
    +463         this.asn1Array.push(this.asn1SubjPKey);
    +464 
    +465         if (this.extensionsArray.length > 0) {
    +466             var extSeq = new _DERSequence({"array": this.extensionsArray});
    +467             var extTagObj = new _DERTaggedObject({'explicit': true,
    +468                                                   'tag': 'a3',
    +469                                                   'obj': extSeq});
    +470             this.asn1Array.push(extTagObj);
    +471         }
     472 
    -473     this._initialize();
    -474 };
    -475 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate, KJUR.asn1.ASN1Object);
    -476 
    -477 // === END   TBSCertificate ===================================================
    +473         var o = new _DERSequence({"array": this.asn1Array});
    +474         this.hTLV = o.getEncodedHex();
    +475         this.isModified = false;
    +476         return this.hTLV;
    +477     };
     478 
    -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  * @example
    -489  * // Extension  ::=  SEQUENCE  {
    -490  * //     extnID      OBJECT IDENTIFIER,
    -491  * //     critical    BOOLEAN DEFAULT FALSE,
    -492  * //     extnValue   OCTET STRING  }
    -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  * append X.509v3 extension to any specified array<br/>
    -530  * @name appendByNameToArray
    -531  * @memberOf KJUR.asn1.x509.Extension
    -532  * @function
    -533  * @param {String} name X.509v3 extension name
    -534  * @param {Object} extParams associative array of extension parameters
    -535  * @param {Array} a array to add specified extension
    -536  * @see KJUR.asn1.x509.Extension
    -537  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    -538  * @description
    -539  * This static function add a X.509v3 extension specified by name and extParams to
    -540  * array 'a' so that 'a' will be an array of X.509v3 extension objects.
    -541  * See {@link KJUR.asn1.x509.TBSCertificate#appendExtensionByName}
    -542  * for supported names of extensions.
    -543  * @example
    -544  * var a = new Array();
    -545  * KJUR.asn1.x509.Extension.appendByNameToArray("BasicConstraints", {'cA':true, 'critical': true}, a);
    -546  * KJUR.asn1.x509.Extension.appendByNameToArray("KeyUsage", {'bin':'11'}, a);
    -547  */
    -548 KJUR.asn1.x509.Extension.appendByNameToArray = function(name, extParams, a) {
    -549     var _lowname = name.toLowerCase(),
    -550 	_KJUR_asn1_x509 = KJUR.asn1.x509;
    -551     
    -552     if (_lowname == "basicconstraints") {
    -553         var extObj = new _KJUR_asn1_x509.BasicConstraints(extParams);
    -554         a.push(extObj);
    -555     } else if (_lowname == "keyusage") {
    -556         var extObj = new _KJUR_asn1_x509.KeyUsage(extParams);
    -557         a.push(extObj);
    -558     } else if (_lowname == "crldistributionpoints") {
    -559         var extObj = new _KJUR_asn1_x509.CRLDistributionPoints(extParams);
    +479     this._initialize();
    +480 };
    +481 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate, KJUR.asn1.ASN1Object);
    +482 
    +483 // === END   TBSCertificate ===================================================
    +484 
    +485 // === BEGIN X.509v3 Extensions Related =======================================
    +486 
    +487 /**
    +488  * base Extension ASN.1 structure class
    +489  * @name KJUR.asn1.x509.Extension
    +490  * @class base Extension ASN.1 structure class
    +491  * @param {Array} params associative array of parameters (ex. {'critical': true})
    +492  * @extends KJUR.asn1.ASN1Object
    +493  * @description
    +494  * @example
    +495  * // Extension  ::=  SEQUENCE  {
    +496  * //     extnID      OBJECT IDENTIFIER,
    +497  * //     critical    BOOLEAN DEFAULT FALSE,
    +498  * //     extnValue   OCTET STRING  }
    +499  */
    +500 KJUR.asn1.x509.Extension = function(params) {
    +501     KJUR.asn1.x509.Extension.superclass.constructor.call(this);
    +502     var asn1ExtnValue = null,
    +503 	_KJUR = KJUR,
    +504 	_KJUR_asn1 = _KJUR.asn1,
    +505 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +506 	_DEROctetString = _KJUR_asn1.DEROctetString,
    +507 	_DERBitString = _KJUR_asn1.DERBitString,
    +508 	_DERBoolean = _KJUR_asn1.DERBoolean,
    +509 	_DERSequence = _KJUR_asn1.DERSequence;
    +510 
    +511     this.getEncodedHex = function() {
    +512         var asn1Oid = new _DERObjectIdentifier({'oid': this.oid});
    +513         var asn1EncapExtnValue =
    +514             new _DEROctetString({'hex': this.getExtnValueHex()});
    +515 
    +516         var asn1Array = new Array();
    +517         asn1Array.push(asn1Oid);
    +518         if (this.critical) asn1Array.push(new _DERBoolean());
    +519         asn1Array.push(asn1EncapExtnValue);
    +520 
    +521         var asn1Seq = new _DERSequence({'array': asn1Array});
    +522         return asn1Seq.getEncodedHex();
    +523     };
    +524 
    +525     this.critical = false;
    +526     if (params !== undefined) {
    +527         if (params.critical !== undefined) {
    +528             this.critical = params.critical;
    +529         }
    +530     }
    +531 };
    +532 YAHOO.lang.extend(KJUR.asn1.x509.Extension, KJUR.asn1.ASN1Object);
    +533 
    +534 /**
    +535  * append X.509v3 extension to any specified array<br/>
    +536  * @name appendByNameToArray
    +537  * @memberOf KJUR.asn1.x509.Extension
    +538  * @function
    +539  * @param {String} name X.509v3 extension name
    +540  * @param {Object} extParams associative array of extension parameters
    +541  * @param {Array} a array to add specified extension
    +542  * @see KJUR.asn1.x509.Extension
    +543  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    +544  * @description
    +545  * This static function add a X.509v3 extension specified by name and extParams to
    +546  * array 'a' so that 'a' will be an array of X.509v3 extension objects.
    +547  * See {@link KJUR.asn1.x509.TBSCertificate#appendExtensionByName}
    +548  * for supported names of extensions.
    +549  * @example
    +550  * var a = new Array();
    +551  * KJUR.asn1.x509.Extension.appendByNameToArray("BasicConstraints", {'cA':true, 'critical': true}, a);
    +552  * KJUR.asn1.x509.Extension.appendByNameToArray("KeyUsage", {'bin':'11'}, a);
    +553  */
    +554 KJUR.asn1.x509.Extension.appendByNameToArray = function(name, extParams, a) {
    +555     var _lowname = name.toLowerCase(),
    +556 	_KJUR_asn1_x509 = KJUR.asn1.x509;
    +557     
    +558     if (_lowname == "basicconstraints") {
    +559         var extObj = new _KJUR_asn1_x509.BasicConstraints(extParams);
     560         a.push(extObj);
    -561     } else if (_lowname == "extkeyusage") {
    -562         var extObj = new _KJUR_asn1_x509.ExtKeyUsage(extParams);
    +561     } else if (_lowname == "keyusage") {
    +562         var extObj = new _KJUR_asn1_x509.KeyUsage(extParams);
     563         a.push(extObj);
    -564     } else if (_lowname == "authoritykeyidentifier") {
    -565         var extObj = new _KJUR_asn1_x509.AuthorityKeyIdentifier(extParams);
    +564     } else if (_lowname == "crldistributionpoints") {
    +565         var extObj = new _KJUR_asn1_x509.CRLDistributionPoints(extParams);
     566         a.push(extObj);
    -567     } else if (_lowname == "subjectkeyidentifier") {
    -568         var extObj = new _KJUR_asn1_x509.SubjectKeyIdentifier(extParams);
    +567     } else if (_lowname == "extkeyusage") {
    +568         var extObj = new _KJUR_asn1_x509.ExtKeyUsage(extParams);
     569         a.push(extObj);
    -570     } else if (_lowname == "authorityinfoaccess") {
    -571         var extObj = new _KJUR_asn1_x509.AuthorityInfoAccess(extParams);
    +570     } else if (_lowname == "authoritykeyidentifier") {
    +571         var extObj = new _KJUR_asn1_x509.AuthorityKeyIdentifier(extParams);
     572         a.push(extObj);
    -573     } else if (_lowname == "subjectaltname") {
    -574         var extObj = new _KJUR_asn1_x509.SubjectAltName(extParams);
    +573     } else if (_lowname == "subjectkeyidentifier") {
    +574         var extObj = new _KJUR_asn1_x509.SubjectKeyIdentifier(extParams);
     575         a.push(extObj);
    -576     } else if (_lowname == "issueraltname") {
    -577         var extObj = new _KJUR_asn1_x509.IssuerAltName(extParams);
    +576     } else if (_lowname == "authorityinfoaccess") {
    +577         var extObj = new _KJUR_asn1_x509.AuthorityInfoAccess(extParams);
     578         a.push(extObj);
    -579     } else {
    -580         throw "unsupported extension name: " + name;
    -581     }
    -582 };
    -583 
    -584 /**
    -585  * KeyUsage ASN.1 structure class
    -586  * @name KJUR.asn1.x509.KeyUsage
    -587  * @class KeyUsage ASN.1 structure class
    -588  * @param {Array} params associative array of parameters (ex. {'bin': '11', 'critical': true})
    -589  * @extends KJUR.asn1.x509.Extension
    -590  * @description
    -591  * This class is for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.3" target="_blank">KeyUsage</a> X.509v3 extension.
    -592  * <pre>
    -593  * id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    -594  * KeyUsage ::= BIT STRING {
    -595  *   digitalSignature   (0),
    -596  *   nonRepudiation     (1),
    -597  *   keyEncipherment    (2),
    -598  *   dataEncipherment   (3),
    -599  *   keyAgreement       (4),
    -600  *   keyCertSign        (5),
    -601  *   cRLSign            (6),
    -602  *   encipherOnly       (7),
    -603  *   decipherOnly       (8) }
    -604  * </pre><br/>
    -605  * NOTE: 'names' parameter is supprted since jsrsasign 8.0.14.
    -606  * @example
    -607  * o = new KJUR.asn1.x509.KeyUsage({bin: "11"});
    -608  * o = new KJUR.asn1.x509.KeyUsage({critical: true, bin: "11"});
    -609  * o = new KJUR.asn1.x509.KeyUsage({names: ['digitalSignature', 'keyAgreement']});
    -610  */
    -611 KJUR.asn1.x509.KeyUsage = function(params) {
    -612     KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this, params);
    -613     var _KEYUSAGE_NAME = X509.KEYUSAGE_NAME;
    -614 
    -615     this.getExtnValueHex = function() {
    -616         return this.asn1ExtnValue.getEncodedHex();
    -617     };
    -618 
    -619     this.oid = "2.5.29.15";
    -620     if (params !== undefined) {
    -621         if (params.bin !== undefined) {
    -622             this.asn1ExtnValue = new KJUR.asn1.DERBitString(params);
    -623         }
    -624 	if (params.names !== undefined &&
    -625 	    params.names.length !== undefined) {
    -626 	    var names = params.names;
    -627 	    var s = "000000000";
    -628 	    for (var i = 0; i < names.length; i++) {
    -629 		for (var j = 0; j < _KEYUSAGE_NAME.length; j++) {
    -630 		    if (names[i] === _KEYUSAGE_NAME[j]) {
    -631 			s = s.substring(0, j) + '1' + 
    -632 			    s.substring(j + 1, s.length);
    -633 		    }
    -634 		}
    -635 	    }
    -636             this.asn1ExtnValue = new KJUR.asn1.DERBitString({bin: s});
    -637 	}
    -638     }
    -639 };
    -640 YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage, KJUR.asn1.x509.Extension);
    -641 
    -642 /**
    -643  * BasicConstraints ASN.1 structure class
    -644  * @name KJUR.asn1.x509.BasicConstraints
    -645  * @class BasicConstraints ASN.1 structure class
    -646  * @param {Array} params associative array of parameters (ex. {'cA': true, 'critical': true})
    -647  * @extends KJUR.asn1.x509.Extension
    -648  * @description
    -649  * @example
    -650  */
    -651 KJUR.asn1.x509.BasicConstraints = function(params) {
    -652     KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this, params);
    -653     var cA = false;
    -654     var pathLen = -1;
    -655 
    -656     this.getExtnValueHex = function() {
    -657         var asn1Array = new Array();
    -658         if (this.cA) asn1Array.push(new KJUR.asn1.DERBoolean());
    -659         if (this.pathLen > -1)
    -660             asn1Array.push(new KJUR.asn1.DERInteger({'int': this.pathLen}));
    -661         var asn1Seq = new KJUR.asn1.DERSequence({'array': asn1Array});
    -662         this.asn1ExtnValue = asn1Seq;
    -663         return this.asn1ExtnValue.getEncodedHex();
    -664     };
    -665 
    -666     this.oid = "2.5.29.19";
    -667     this.cA = false;
    -668     this.pathLen = -1;
    -669     if (params !== undefined) {
    -670         if (params.cA !== undefined) {
    -671             this.cA = params.cA;
    -672         }
    -673         if (params.pathLen !== undefined) {
    -674             this.pathLen = params.pathLen;
    -675         }
    -676     }
    -677 };
    -678 YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints, KJUR.asn1.x509.Extension);
    -679 
    -680 /**
    -681  * CRLDistributionPoints ASN.1 structure class
    -682  * @name KJUR.asn1.x509.CRLDistributionPoints
    -683  * @class CRLDistributionPoints ASN.1 structure class
    -684  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
    -685  * @extends KJUR.asn1.x509.Extension
    -686  * @description
    -687  * <pre>
    -688  * id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 }
    -689  *
    -690  * CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
    -691  *
    -692  * DistributionPoint ::= SEQUENCE {
    -693  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    -694  *      reasons                 [1]     ReasonFlags OPTIONAL,
    -695  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    -696  *
    -697  * DistributionPointName ::= CHOICE {
    -698  *      fullName                [0]     GeneralNames,
    -699  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    -700  * 
    -701  * ReasonFlags ::= BIT STRING {
    -702  *      unused                  (0),
    -703  *      keyCompromise           (1),
    -704  *      cACompromise            (2),
    -705  *      affiliationChanged      (3),
    -706  *      superseded              (4),
    -707  *      cessationOfOperation    (5),
    -708  *      certificateHold         (6),
    -709  *      privilegeWithdrawn      (7),
    -710  *      aACompromise            (8) }
    -711  * </pre>
    -712  * @example
    -713  */
    -714 KJUR.asn1.x509.CRLDistributionPoints = function(params) {
    -715     KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this, params);
    -716     var _KJUR = KJUR,
    -717 	_KJUR_asn1 = _KJUR.asn1,
    -718 	_KJUR_asn1_x509 = _KJUR_asn1.x509;
    -719 
    -720     this.getExtnValueHex = function() {
    -721         return this.asn1ExtnValue.getEncodedHex();
    -722     };
    -723 
    -724     this.setByDPArray = function(dpArray) {
    -725         this.asn1ExtnValue = new _KJUR_asn1.DERSequence({'array': dpArray});
    -726     };
    -727 
    -728     this.setByOneURI = function(uri) {
    -729         var gn1 = new _KJUR_asn1_x509.GeneralNames([{'uri': uri}]);
    -730         var dpn1 = new _KJUR_asn1_x509.DistributionPointName(gn1);
    -731         var dp1 = new _KJUR_asn1_x509.DistributionPoint({'dpobj': dpn1});
    -732         this.setByDPArray([dp1]);
    -733     };
    -734 
    -735     this.oid = "2.5.29.31";
    -736     if (params !== undefined) {
    -737         if (params.array !== undefined) {
    -738             this.setByDPArray(params.array);
    -739         } else if (params.uri !== undefined) {
    -740             this.setByOneURI(params.uri);
    -741         }
    -742     }
    -743 };
    -744 YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints, KJUR.asn1.x509.Extension);
    -745 
    -746 /**
    -747  * KeyUsage ASN.1 structure class
    -748  * @name KJUR.asn1.x509.ExtKeyUsage
    -749  * @class ExtKeyUsage ASN.1 structure class
    -750  * @param {Array} params associative array of parameters
    -751  * @extends KJUR.asn1.x509.Extension
    -752  * @description
    -753  * @example
    -754  * e1 = new KJUR.asn1.x509.ExtKeyUsage({
    -755  *   critical: true,
    -756  *   array: [
    -757  *     {oid: '2.5.29.37.0'},  // anyExtendedKeyUsage
    -758  *     {name: 'clientAuth'}
    -759  *   ]
    -760  * });
    -761  * // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
    -762  * // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
    -763  * // KeyPurposeId ::= OBJECT IDENTIFIER
    -764  */
    -765 KJUR.asn1.x509.ExtKeyUsage = function(params) {
    -766     KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this, params);
    -767     var _KJUR = KJUR,
    -768 	_KJUR_asn1 = _KJUR.asn1;
    -769 
    -770     this.setPurposeArray = function(purposeArray) {
    -771         this.asn1ExtnValue = new _KJUR_asn1.DERSequence();
    -772         for (var i = 0; i < purposeArray.length; i++) {
    -773             var o = new _KJUR_asn1.DERObjectIdentifier(purposeArray[i]);
    -774             this.asn1ExtnValue.appendASN1Object(o);
    -775         }
    -776     };
    -777 
    -778     this.getExtnValueHex = function() {
    -779         return this.asn1ExtnValue.getEncodedHex();
    -780     };
    -781 
    -782     this.oid = "2.5.29.37";
    -783     if (params !== undefined) {
    -784         if (params.array !== undefined) {
    -785             this.setPurposeArray(params.array);
    -786         }
    -787     }
    -788 };
    -789 YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage, KJUR.asn1.x509.Extension);
    -790 
    -791 /**
    -792  * AuthorityKeyIdentifier ASN.1 structure class
    -793  * @name KJUR.asn1.x509.AuthorityKeyIdentifier
    -794  * @class AuthorityKeyIdentifier ASN.1 structure class
    -795  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    -796  * @extends KJUR.asn1.x509.Extension
    -797  * @since asn1x509 1.0.8
    -798  * @description
    -799  * 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>.
    -800  * Constructor of this class may have following parameters.: 
    -801  * <ul>
    -802  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of authority public key or authcertificate 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>
    -803  * <li>isscert - When PEM string of authority certificate is specified, both authorityCertIssuer and authorityCertSerialNumber will be set by the certificate.</li>
    -804  * <li>issuer - {@link KJUR.asn1.x509.X500Name} parameter to specify issuer name explicitly.</li>
    -805  * <li>sn - hexadecimal string to specify serial number explicitly.</li>
    -806  * <li>critical - boolean to specify criticality of this extension
    -807  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    -808  * </ul>
    -809  * 
    -810  * <pre>
    -811  * d-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
    -812  * AuthorityKeyIdentifier ::= SEQUENCE {
    -813  *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
    -814  *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
    -815  *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
    -816  * KeyIdentifier ::= OCTET STRING
    -817  * </pre>
    -818  *
    -819  * @example
    -820  * // 1. kid by key object
    -821  * keyobj = KEYUTIL.getKey("-----BEGIN PUBLIC KEY...");
    -822  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: keyobj});
    -823  * // 2. kid by PEM string of authority certificate or public key
    -824  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "-----BEGIN..."});
    -825  * // 3. specify kid explicitly
    -826  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "8ab1d3..."});
    -827  * });
    -828  * // 4. issuer and serial number by auhtority PEM certificate
    -829  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({isscert: "-----BEGIN..."});
    -830  * // 5. issuer and serial number explicitly
    -831  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    -832  *   issuer: {ldapstr: "O=test,C=US"},
    -833  *   sn: {hex: "1ac7..."}});
    -834  * // 6. combination
    -835  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    -836  *   kid: "-----BEGIN CERTIFICATE...",
    -837  *   isscert: "-----BEGIN CERTIFICATE..."});
    -838  */
    -839 KJUR.asn1.x509.AuthorityKeyIdentifier = function(params) {
    -840     KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this, params);
    -841     var _KJUR = KJUR,
    -842 	_KJUR_asn1 = _KJUR.asn1,
    -843 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -844 	_GeneralNames = _KJUR_asn1.x509.GeneralNames,
    -845 	_isKey = _KJUR.crypto.Util.isKey;
    -846 
    -847     this.asn1KID = null;
    -848     this.asn1CertIssuer = null; // X500Name hTLV
    -849     this.asn1CertSN = null;
    -850 
    -851     this.getExtnValueHex = function() {
    -852         var a = new Array();
    -853         if (this.asn1KID)
    -854             a.push(new _DERTaggedObject({'explicit': false,
    -855                                          'tag': '80',
    -856                                          'obj': this.asn1KID}));
    -857 
    -858         if (this.asn1CertIssuer)
    -859             a.push(new _DERTaggedObject({'explicit': false,
    -860                                          'tag': 'a1',
    -861                                          'obj': new _GeneralNames([{dn: this.asn1CertIssuer}])}));
    -862 
    -863         if (this.asn1CertSN)
    -864             a.push(new _DERTaggedObject({'explicit': false,
    -865                                          'tag': '82',
    -866                                          'obj': this.asn1CertSN}));
    -867 
    -868         var asn1Seq = new _KJUR_asn1.DERSequence({'array': a});
    -869         this.asn1ExtnValue = asn1Seq;
    -870         return this.asn1ExtnValue.getEncodedHex();
    -871     };
    -872 
    -873     /**
    -874      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    -875      * @name setKIDByParam
    -876      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -877      * @function
    -878      * @param {Array} param parameter to set key identifier
    -879      * @since asn1x509 1.0.8
    -880      * @description
    -881      * This method will set keyIdentifier by param.
    -882      * Its key identifier value can be set by following type of param argument:
    -883      * <ul>
    -884      * <li>{str: "123"} - by raw string</li>
    -885      * <li>{hex: "01af..."} - by hexadecimal value</li>
    -886      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    -887      * key identifier value will be calculated by the method described in
    -888      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -889      * </li>
    -890      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    -891      * certificate and
    -892      * key identifier value will be calculated by the method described in
    -893      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -894      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    -895      * to PKCS#8 ASN.1 structure then calculate 
    -896      * a key identifier value will be calculated by the method described in
    -897      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -898      * </ul>
    -899      *
    -900      * NOTE1: Automatic key identifier calculation is supported
    -901      * since jsrsasign 8.0.16.
    -902      *
    -903      * @see KEYUTIL.getKeyID
    -904      * 
    -905      * @example
    -906      * o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    -907      * // set by hexadecimal string
    -908      * o.setKIDByParam({hex: '1ad9...'});
    -909      * // set by SubjectPublicKeyInfo of PEM certificate string
    -910      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    -911      * // set by PKCS#8 PEM public key string
    -912      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    -913      * // set by public key object
    -914      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -915      * o.setKIDByParam(pubkey);
    -916      */
    -917     this.setKIDByParam = function(param) {
    -918 	if (param.str !== undefined ||
    -919 	    param.hex !== undefined) {
    -920 	    this.asn1KID = new KJUR.asn1.DEROctetString(param);
    -921 	} else if ((typeof param === "object" &&
    -922 		    KJUR.crypto.Util.isKey(param)) ||
    -923 		   (typeof param === "string" &&
    -924 		    param.indexOf("BEGIN ") != -1)) {
    -925 
    -926 	    var keyobj = param;
    -927 	    if (typeof param === "string") {
    -928 		keyobj = KEYUTIL.getKey(param);
    -929 	    }
    -930 
    -931 	    var kid = KEYUTIL.getKeyID(keyobj);
    -932 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    -933 	}
    -934     };
    -935 
    -936     /**
    -937      * set authorityCertIssuer value by X500Name parameter
    -938      * @name setCertIssuerByParam
    -939      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -940      * @function
    -941      * @param {Array} param parameter to set issuer name
    -942      * @since asn1x509 1.0.8
    -943      * @description
    -944      * This method will set authorityCertIssuer name by param.
    -945      * Issuer name can be set by following type of param argument:
    -946      * <ul>
    -947      * <li>str/ldapstr/hex/certsubject/certissuer - 
    -948      * set issuer by {@link KJUR.asn1.x509.X500Name}
    -949      * object with specified parameters.</li>
    -950      * <li>PEM CERTIFICATE STRING - extract its subject name from 
    -951      * specified issuer PEM certificate and set.
    -952      * </ul>
    -953      * NOTE1: Automatic authorityCertIssuer setting by certificate
    -954      * is supported since jsrsasign 8.0.16.
    -955      *
    -956      * @see KJUR.asn1.x509.X500Name
    -957      * @see KJUR.asn1.x509.GeneralNames
    -958      * @see X509.getSubjectHex
    -959      *
    -960      * @example
    -961      * var o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    -962      * // 1. set it by string
    -963      * o.setCertIssuerByParam({str: '/C=US/O=Test'});
    -964      * // 2. set it by issuer PEM certificate
    -965      * o.setCertIssuerByParam("-----BEGIN CERTIFICATE...");
    -966      *
    -967      */
    -968     this.setCertIssuerByParam = function(param) {
    -969 	if (param.str !== undefined ||
    -970 	    param.ldapstr !== undefined ||
    -971 	    param.hex !== undefined ||
    -972 	    param.certsubject !== undefined ||
    -973 	    param.certissuer !== undefined) {
    -974             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name(param);
    -975 	} else if (typeof param === "string" &&
    -976 		   param.indexOf("BEGIN ") != -1 &&
    -977 		   param.indexOf("CERTIFICATE") != -1) {
    -978             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name({certissuer: param});
    -979 	}
    -980     };
    -981 
    -982     /**
    -983      * set authorityCertSerialNumber value
    -984      * @name setCertSerialNumberByParam
    -985      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    -986      * @function
    -987      * @param {Object} param parameter to set serial number
    -988      * @since asn1x509 1.0.8
    -989      * @description
    -990      * This method will set authorityCertSerialNumber by param.
    -991      * Serial number can be set by following type of param argument:
    -992      *
    -993      * <ul>
    -994      * <li>{int: 123} - by integer value</li>
    -995      * <li>{hex: "01af"} - by hexadecimal integer value</li>
    -996      * <li>{bigint: new BigInteger(...)} - by hexadecimal integer value</li>
    -997      * <li>PEM CERTIFICATE STRING - extract serial number from issuer certificate and
    -998      * set serial number.
    -999      * 
    -1000      * NOTE1: Automatic authorityCertSerialNumber setting by certificate
    -1001      * is supported since jsrsasign 8.0.16.
    -1002      *
    -1003      * @see X509.getSerialNumberHex
    -1004      */
    -1005     this.setCertSNByParam = function(param) {
    -1006 	if (param.str !== undefined ||
    -1007 	    param.bigint !== undefined ||
    -1008 	    param.hex !== undefined) {
    -1009             this.asn1CertSN = new KJUR.asn1.DERInteger(param);
    -1010 	} else if (typeof param === "string" &&
    -1011 		   param.indexOf("BEGIN ") != -1 &&
    -1012 		   param.indexOf("CERTIFICATE")) {
    -1013 
    -1014             var x = new X509();
    -1015             x.readCertPEM(param);
    -1016 	    var sn = x.getSerialNumberHex();
    -1017 	    this.asn1CertSN = new KJUR.asn1.DERInteger({hex: sn});
    -1018 	}
    -1019     };
    -1020 
    -1021     this.oid = "2.5.29.35";
    -1022     if (params !== undefined) {
    -1023         if (params.kid !== undefined) {
    -1024             this.setKIDByParam(params.kid);
    -1025         }
    -1026         if (params.issuer !== undefined) {
    -1027             this.setCertIssuerByParam(params.issuer);
    -1028         }
    -1029         if (params.sn !== undefined) {
    -1030             this.setCertSNByParam(params.sn);
    -1031         }
    -1032 
    -1033 	if (params.issuersn !== undefined &&
    -1034 	    typeof params.issuersn === "string" &&
    -1035 	    params.issuersn.indexOf("BEGIN ") != -1 &&
    -1036 	    params.issuersn.indexOf("CERTIFICATE")) {
    -1037 	    this.setCertSNByParam(params.issuersn);
    -1038 	    this.setCertIssuerByParam(params.issuersn);
    -1039 	}
    -1040     }
    -1041 };
    -1042 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier, KJUR.asn1.x509.Extension);
    -1043 
    -1044 /**
    -1045  * SubjectKeyIdentifier ASN.1 structure class
    -1046  * @name KJUR.asn1.x509.SubjectKeyIdentifier
    -1047  * @class SubjectKeyIdentifier ASN.1 structure class
    -1048  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    -1049  * @extends KJUR.asn1.x509.Extension
    -1050  * @since asn1x509 1.1.7 jsrsasign 8.0.14
    -1051  * @description
    -1052  * This class represents ASN.1 structure for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">SubjectKeyIdentifier in RFC 5280</a>.
    -1053  * Constructor of this class may have following parameters:
    -1054  * <ul>
    -1055  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of authority public key or authcertificate 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>
    -1056  * <li>critical - boolean to specify criticality of this extension
    -1057  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    -1058  * </ul>
    -1059  * <pre>
    -1060  * d-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 }
    -1061  * SubjectKeyIdentifier ::= KeyIdentifier
    -1062  * KeyIdentifier ::= OCTET STRING
    -1063  * </pre>
    -1064  *
    -1065  * @example
    -1066  * // set by hexadecimal string
    -1067  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: {hex: '89ab'}});
    -1068  * // set by PEM public key or certificate string
    -1069  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: "-----BEGIN CERTIFICATE..."});
    -1070  * // set by public key object
    -1071  * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -1072  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: pubkey});
    -1073  */
    -1074 KJUR.asn1.x509.SubjectKeyIdentifier = function(params) {
    -1075     KJUR.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this, params);
    -1076     var _KJUR = KJUR,
    -1077 	_KJUR_asn1 = _KJUR.asn1,
    -1078 	_DEROctetString = _KJUR_asn1.DEROctetString;
    -1079 
    -1080     this.asn1KID = null;
    -1081 
    -1082     this.getExtnValueHex = function() {
    -1083         this.asn1ExtnValue = this.asn1KID;
    -1084         return this.asn1ExtnValue.getEncodedHex();
    -1085     };
    -1086 
    -1087     /**
    -1088      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    -1089      * @name setKIDByParam
    -1090      * @memberOf KJUR.asn1.x509.SubjectKeyIdentifier#
    -1091      * @function
    -1092      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
    -1093      * @since asn1x509 1.1.7 jsrsasign 8.0.14
    -1094      * @description
    -1095      * <ul>
    -1096      * <li>{str: "123"} - by raw string</li>
    -1097      * <li>{hex: "01af..."} - by hexadecimal value</li>
    -1098      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    -1099      * key identifier value will be calculated by the method described in
    -1100      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1101      * </li>
    -1102      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    -1103      * certificate and
    -1104      * key identifier value will be calculated by the method described in
    -1105      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1106      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    -1107      * to PKCS#8 ASN.1 structure then calculate 
    -1108      * a key identifier value will be calculated by the method described in
    -1109      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    -1110      * </ul>
    -1111      *
    -1112      * NOTE1: Automatic key identifier calculation is supported
    -1113      * since jsrsasign 8.0.16.
    -1114      *
    -1115      * @see KEYUTIL.getKeyID
    -1116      *
    -1117      * @example
    -1118      * o = new KJUR.asn1.x509.SubjectKeyIdentifier();
    -1119      * // set by hexadecimal string
    -1120      * o.setKIDByParam({hex: '1ad9...'});
    -1121      * // set by SubjectPublicKeyInfo of PEM certificate string
    -1122      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    -1123      * // set by PKCS#8 PEM public key string
    -1124      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    -1125      * // set by public key object
    -1126      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    -1127      * o.setKIDByParam(pubkey);
    -1128      */
    -1129     this.setKIDByParam = function(param) {
    -1130 	if (param.str !== undefined ||
    -1131 	    param.hex !== undefined) {
    -1132 	    this.asn1KID = new _DEROctetString(param);
    -1133 	} else if ((typeof param === "object" &&
    -1134 		    KJUR.crypto.Util.isKey(param)) ||
    -1135 		   (typeof param === "string" &&
    -1136 		    param.indexOf("BEGIN") != -1)) {
    -1137 
    -1138 	    var keyobj = param;
    -1139 	    if (typeof param === "string") {
    -1140 		keyobj = KEYUTIL.getKey(param);
    -1141 	    }
    -1142 
    -1143 	    var kid = KEYUTIL.getKeyID(keyobj);
    -1144 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    -1145 	}
    -1146     };
    -1147 
    -1148     this.oid = "2.5.29.14";
    -1149     if (params !== undefined) {
    -1150 	if (params.kid !== undefined) {
    -1151 	    this.setKIDByParam(params.kid);
    -1152 	}
    -1153     }
    -1154 };
    -1155 YAHOO.lang.extend(KJUR.asn1.x509.SubjectKeyIdentifier, KJUR.asn1.x509.Extension);
    -1156 
    -1157 /**
    -1158  * AuthorityInfoAccess ASN.1 structure class
    -1159  * @name KJUR.asn1.x509.AuthorityInfoAccess
    -1160  * @class AuthorityInfoAccess ASN.1 structure class
    -1161  * @param {Array} params associative array of parameters
    -1162  * @extends KJUR.asn1.x509.Extension
    -1163  * @since asn1x509 1.0.8
    -1164  * @description
    -1165  * <pre>
    -1166  * id-pe OBJECT IDENTIFIER  ::=  { id-pkix 1 }
    -1167  * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
    -1168  * AuthorityInfoAccessSyntax  ::=
    -1169  *         SEQUENCE SIZE (1..MAX) OF AccessDescription
    -1170  * AccessDescription  ::=  SEQUENCE {
    -1171  *         accessMethod          OBJECT IDENTIFIER,
    -1172  *         accessLocation        GeneralName  }
    -1173  * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
    -1174  * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
    -1175  * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
    -1176  * </pre>
    -1177  * @example
    -1178  * e1 = new KJUR.asn1.x509.AuthorityInfoAccess({
    -1179  *   array: [{
    -1180  *     accessMethod:{'oid': '1.3.6.1.5.5.7.48.1'},
    -1181  *     accessLocation:{'uri': 'http://ocsp.cacert.org'}
    -1182  *   }]
    -1183  * });
    -1184  */
    -1185 KJUR.asn1.x509.AuthorityInfoAccess = function(params) {
    -1186     KJUR.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this, params);
    -1187 
    -1188     this.setAccessDescriptionArray = function(accessDescriptionArray) {
    -1189         var array = new Array(),
    -1190 	    _KJUR = KJUR,
    -1191 	    _KJUR_asn1 = _KJUR.asn1,
    -1192 	    _DERSequence = _KJUR_asn1.DERSequence;
    -1193 
    -1194         for (var i = 0; i < accessDescriptionArray.length; i++) {
    -1195             var o = new _KJUR_asn1.DERObjectIdentifier(accessDescriptionArray[i].accessMethod);
    -1196             var gn = new _KJUR_asn1.x509.GeneralName(accessDescriptionArray[i].accessLocation);
    -1197             var accessDescription = new _DERSequence({'array':[o, gn]});
    -1198             array.push(accessDescription);
    -1199         }
    -1200         this.asn1ExtnValue = new _DERSequence({'array':array});
    -1201     };
    -1202 
    -1203     this.getExtnValueHex = function() {
    -1204         return this.asn1ExtnValue.getEncodedHex();
    -1205     };
    -1206 
    -1207     this.oid = "1.3.6.1.5.5.7.1.1";
    -1208     if (params !== undefined) {
    -1209         if (params.array !== undefined) {
    -1210             this.setAccessDescriptionArray(params.array);
    -1211         }
    -1212     }
    -1213 };
    -1214 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityInfoAccess, KJUR.asn1.x509.Extension);
    -1215 
    -1216 /**
    -1217  * SubjectAltName ASN.1 structure class<br/>
    -1218  * @name KJUR.asn1.x509.SubjectAltName
    -1219  * @class SubjectAltName ASN.1 structure class
    -1220  * @param {Array} params associative array of parameters
    -1221  * @extends KJUR.asn1.x509.Extension
    -1222  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    -1223  * @see KJUR.asn1.x509.GeneralNames
    -1224  * @see KJUR.asn1.x509.GeneralName
    -1225  * @description
    -1226  * This class provides X.509v3 SubjectAltName extension.
    -1227  * <pre>
    -1228  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 }
    -1229  * SubjectAltName ::= GeneralNames
    -1230  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -1231  * GeneralName ::= CHOICE {
    -1232  *   otherName                  [0] OtherName,
    -1233  *   rfc822Name                 [1] IA5String,
    -1234  *   dNSName                    [2] IA5String,
    -1235  *   x400Address                [3] ORAddress,
    -1236  *   directoryName              [4] Name,
    -1237  *   ediPartyName               [5] EDIPartyName,
    -1238  *   uniformResourceIdentifier  [6] IA5String,
    -1239  *   iPAddress                  [7] OCTET STRING,
    -1240  *   registeredID               [8] OBJECT IDENTIFIER }
    -1241  * </pre>
    -1242  * @example
    -1243  * e1 = new KJUR.asn1.x509.SubjectAltName({
    -1244  *   critical: true,
    -1245  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    -1246  * });
    -1247  */
    -1248 KJUR.asn1.x509.SubjectAltName = function(params) {
    -1249     KJUR.asn1.x509.SubjectAltName.superclass.constructor.call(this, params)
    -1250 
    -1251     this.setNameArray = function(paramsArray) {
    -1252 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    -1253     };
    -1254 
    -1255     this.getExtnValueHex = function() {
    -1256         return this.asn1ExtnValue.getEncodedHex();
    -1257     };
    +579     } else if (_lowname == "subjectaltname") {
    +580         var extObj = new _KJUR_asn1_x509.SubjectAltName(extParams);
    +581         a.push(extObj);
    +582     } else if (_lowname == "issueraltname") {
    +583         var extObj = new _KJUR_asn1_x509.IssuerAltName(extParams);
    +584         a.push(extObj);
    +585     } else if (_lowname == "certificatepolicies") {
    +586         var extObj = new _KJUR_asn1_x509.CertificatePolicies(extParams);
    +587         a.push(extObj);
    +588     } else {
    +589         throw new Error("unsupported extension name: " + name);
    +590     }
    +591 };
    +592 
    +593 /**
    +594  * KeyUsage ASN.1 structure class
    +595  * @name KJUR.asn1.x509.KeyUsage
    +596  * @class KeyUsage ASN.1 structure class
    +597  * @param {Array} params associative array of parameters (ex. {'bin': '11', 'critical': true})
    +598  * @extends KJUR.asn1.x509.Extension
    +599  * @description
    +600  * This class is for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.3" target="_blank">KeyUsage</a> X.509v3 extension.
    +601  * <pre>
    +602  * id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +603  * KeyUsage ::= BIT STRING {
    +604  *   digitalSignature   (0),
    +605  *   nonRepudiation     (1),
    +606  *   keyEncipherment    (2),
    +607  *   dataEncipherment   (3),
    +608  *   keyAgreement       (4),
    +609  *   keyCertSign        (5),
    +610  *   cRLSign            (6),
    +611  *   encipherOnly       (7),
    +612  *   decipherOnly       (8) }
    +613  * </pre><br/>
    +614  * NOTE: 'names' parameter is supprted since jsrsasign 8.0.14.
    +615  * @example
    +616  * o = new KJUR.asn1.x509.KeyUsage({bin: "11"});
    +617  * o = new KJUR.asn1.x509.KeyUsage({critical: true, bin: "11"});
    +618  * o = new KJUR.asn1.x509.KeyUsage({names: ['digitalSignature', 'keyAgreement']});
    +619  */
    +620 KJUR.asn1.x509.KeyUsage = function(params) {
    +621     KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this, params);
    +622     var _KEYUSAGE_NAME = X509.KEYUSAGE_NAME;
    +623 
    +624     this.getExtnValueHex = function() {
    +625         return this.asn1ExtnValue.getEncodedHex();
    +626     };
    +627 
    +628     this.oid = "2.5.29.15";
    +629     if (params !== undefined) {
    +630         if (params.bin !== undefined) {
    +631             this.asn1ExtnValue = new KJUR.asn1.DERBitString(params);
    +632         }
    +633 	if (params.names !== undefined &&
    +634 	    params.names.length !== undefined) {
    +635 	    var names = params.names;
    +636 	    var s = "000000000";
    +637 	    for (var i = 0; i < names.length; i++) {
    +638 		for (var j = 0; j < _KEYUSAGE_NAME.length; j++) {
    +639 		    if (names[i] === _KEYUSAGE_NAME[j]) {
    +640 			s = s.substring(0, j) + '1' + 
    +641 			    s.substring(j + 1, s.length);
    +642 		    }
    +643 		}
    +644 	    }
    +645             this.asn1ExtnValue = new KJUR.asn1.DERBitString({bin: s});
    +646 	}
    +647     }
    +648 };
    +649 YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage, KJUR.asn1.x509.Extension);
    +650 
    +651 /**
    +652  * BasicConstraints ASN.1 structure class
    +653  * @name KJUR.asn1.x509.BasicConstraints
    +654  * @class BasicConstraints ASN.1 structure class
    +655  * @param {Array} params associative array of parameters (ex. {'cA': true, 'critical': true})
    +656  * @extends KJUR.asn1.x509.Extension
    +657  * @description
    +658  * @example
    +659  */
    +660 KJUR.asn1.x509.BasicConstraints = function(params) {
    +661     KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this, params);
    +662     var cA = false;
    +663     var pathLen = -1;
    +664 
    +665     this.getExtnValueHex = function() {
    +666         var asn1Array = new Array();
    +667         if (this.cA) asn1Array.push(new KJUR.asn1.DERBoolean());
    +668         if (this.pathLen > -1)
    +669             asn1Array.push(new KJUR.asn1.DERInteger({'int': this.pathLen}));
    +670         var asn1Seq = new KJUR.asn1.DERSequence({'array': asn1Array});
    +671         this.asn1ExtnValue = asn1Seq;
    +672         return this.asn1ExtnValue.getEncodedHex();
    +673     };
    +674 
    +675     this.oid = "2.5.29.19";
    +676     this.cA = false;
    +677     this.pathLen = -1;
    +678     if (params !== undefined) {
    +679         if (params.cA !== undefined) {
    +680             this.cA = params.cA;
    +681         }
    +682         if (params.pathLen !== undefined) {
    +683             this.pathLen = params.pathLen;
    +684         }
    +685     }
    +686 };
    +687 YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints, KJUR.asn1.x509.Extension);
    +688 
    +689 /**
    +690  * CRLDistributionPoints ASN.1 structure class
    +691  * @name KJUR.asn1.x509.CRLDistributionPoints
    +692  * @class CRLDistributionPoints ASN.1 structure class
    +693  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
    +694  * @extends KJUR.asn1.x509.Extension
    +695  * @description
    +696  * <pre>
    +697  * id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 }
    +698  *
    +699  * CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
    +700  *
    +701  * DistributionPoint ::= SEQUENCE {
    +702  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    +703  *      reasons                 [1]     ReasonFlags OPTIONAL,
    +704  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    +705  *
    +706  * DistributionPointName ::= CHOICE {
    +707  *      fullName                [0]     GeneralNames,
    +708  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    +709  * 
    +710  * ReasonFlags ::= BIT STRING {
    +711  *      unused                  (0),
    +712  *      keyCompromise           (1),
    +713  *      cACompromise            (2),
    +714  *      affiliationChanged      (3),
    +715  *      superseded              (4),
    +716  *      cessationOfOperation    (5),
    +717  *      certificateHold         (6),
    +718  *      privilegeWithdrawn      (7),
    +719  *      aACompromise            (8) }
    +720  * </pre>
    +721  * @example
    +722  */
    +723 KJUR.asn1.x509.CRLDistributionPoints = function(params) {
    +724     KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this, params);
    +725     var _KJUR = KJUR,
    +726 	_KJUR_asn1 = _KJUR.asn1,
    +727 	_KJUR_asn1_x509 = _KJUR_asn1.x509;
    +728 
    +729     this.getExtnValueHex = function() {
    +730         return this.asn1ExtnValue.getEncodedHex();
    +731     };
    +732 
    +733     this.setByDPArray = function(dpArray) {
    +734         this.asn1ExtnValue = new _KJUR_asn1.DERSequence({'array': dpArray});
    +735     };
    +736 
    +737     this.setByOneURI = function(uri) {
    +738         var gn1 = new _KJUR_asn1_x509.GeneralNames([{'uri': uri}]);
    +739         var dpn1 = new _KJUR_asn1_x509.DistributionPointName(gn1);
    +740         var dp1 = new _KJUR_asn1_x509.DistributionPoint({'dpobj': dpn1});
    +741         this.setByDPArray([dp1]);
    +742     };
    +743 
    +744     this.oid = "2.5.29.31";
    +745     if (params !== undefined) {
    +746         if (params.array !== undefined) {
    +747             this.setByDPArray(params.array);
    +748         } else if (params.uri !== undefined) {
    +749             this.setByOneURI(params.uri);
    +750         }
    +751     }
    +752 };
    +753 YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints, KJUR.asn1.x509.Extension);
    +754 
    +755 /**
    +756  * CertificatePolicies ASN.1 structure class
    +757  * @name KJUR.asn1.x509.CertificatePolicies
    +758  * @class CertificatePolicies ASN.1 structure class
    +759  * @param {Array} params associative array of parameters
    +760  * @extends KJUR.asn1.x509.Extension
    +761  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +762  * @description
    +763  * This class represents 
    +764  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +765  * CertificatePolicies extension defined in RFC 5280 4.2.1.4</a>.
    +766  * <pre>
    +767  * id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }
    +768  * CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
    +769  * </pre>
    +770  * Its constructor can have following parameters:
    +771  * <ul>
    +772  * <li>array - array of {@link KJUR.asn1.x509.PolicyInformation} parameter</li>
    +773  * <li>critical - boolean: critical flag
    +774  * </ul>
    +775  * @example
    +776  * e1 = new KJUR.asn1.x509.CertificatePolicies({
    +777  *   array: [
    +778  *     { policyoid: "1.2.3.4.5",
    +779  *       array: [
    +780  *         { cps: "https://example.com/repository" },
    +781  *         { unotice: {
    +782  *           noticeref: { // CA SHOULD NOT use this by RFC
    +783  *             org: {type: "ia5", str: "Sample Org"},
    +784  *             noticenum: [{int: 5}, {hex: "01af"}]
    +785  *           },
    +786  *           exptext: {type: "ia5", str: "Sample Policy"}
    +787  *         }}
    +788  *       ]
    +789  *     }
    +790  *   ],
    +791  *   critical: true
    +792  * });
    +793  */
    +794 KJUR.asn1.x509.CertificatePolicies = function(params) {
    +795     KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this, params);
    +796     var _KJUR = KJUR,
    +797 	_KJUR_asn1 = _KJUR.asn1,
    +798 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +799 	_DERSequence = _KJUR_asn1.DERSequence,
    +800 	_PolicyInformation = _KJUR_asn1_x509.PolicyInformation;
    +801 
    +802     this.params = null;
    +803 
    +804     this.getExtnValueHex = function() {
    +805 	var aPI = [];
    +806 	for (var i = 0; i < this.params.array.length; i++) {
    +807 	    aPI.push(new _PolicyInformation(this.params.array[i]));
    +808 	}
    +809 	var seq = new _DERSequence({array: aPI});
    +810 	this.asn1ExtnValue = seq;
    +811         return this.asn1ExtnValue.getEncodedHex();
    +812     };
    +813 
    +814     this.oid = "2.5.29.32";
    +815     if (params !== undefined) {
    +816 	this.params = params;
    +817     }
    +818 };
    +819 YAHOO.lang.extend(KJUR.asn1.x509.CertificatePolicies, KJUR.asn1.x509.Extension);
    +820 
    +821 /**
    +822  * PolicyInformation ASN.1 structure class
    +823  * @name KJUR.asn1.x509.PolicyInformation
    +824  * @class PolicyInformation ASN.1 structure class
    +825  * @param {Array} params associative array of parameters
    +826  * @extends KJUR.asn1.ASN1Object
    +827  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +828  * @description
    +829  * This class represents 
    +830  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +831  * PolicyInformation defined in RFC 5280 4.2.1.4</a>.
    +832  * <pre>
    +833  * PolicyInformation ::= SEQUENCE {
    +834  *      policyIdentifier   CertPolicyId,
    +835  *      policyQualifiers   SEQUENCE SIZE (1..MAX) OF
    +836  *                         PolicyQualifierInfo OPTIONAL }
    +837  * CertPolicyId ::= OBJECT IDENTIFIER
    +838  * Its constructor can have following parameters:
    +839  * <ul>
    +840  * <li>{String}policyoid - policy OID (ex. "1.2.3.4.5")</li>
    +841  * <li>{Object}array - array of {@link KJUR.asn1.x509.PolicyQualifierInfo}
    +842  * parameters (OPTIONAL)</li>
    +843  * </ul>
    +844  * @example
    +845  * new KJUR.asn1.x509.PolicyInformation({
    +846  *   policyoid: "1.2.3.4.5",
    +847  *   array: [
    +848  *     { cps: "https://example.com/repository" },
    +849  *     { unotice: {
    +850  *       noticeref: { // CA SHOULD NOT use this by RFC
    +851  *         org: {type: "ia5", str: "Sample Org"},
    +852  *         noticenum: [{int: 5}, {hex: "01af"}]
    +853  *       },
    +854  *       exptext: {type: "ia5", str: "Sample Policy"}
    +855  *     }}
    +856  *   ]
    +857  * })
    +858  */
    +859 KJUR.asn1.x509.PolicyInformation = function(params) {
    +860     KJUR.asn1.x509.PolicyInformation.superclass.constructor.call(this,
    +861 								 params);
    +862     var _KJUR_asn1 = KJUR.asn1,
    +863 	_DERSequence = _KJUR_asn1.DERSequence,
    +864 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +865 	_PolicyQualifierInfo = _KJUR_asn1.x509.PolicyQualifierInfo;
    +866 
    +867     this.params = null;
    +868 
    +869     this.getEncodedHex = function() {
    +870 	if (this.params.policyoid === undefined &&
    +871 	    this.params.array === undefined)
    +872 	    throw new Error("parameter oid and array missing");
    +873 
    +874 	// policy oid
    +875 	var a = [new _DERObjectIdentifier({oid: this.params.policyoid})];
    +876 
    +877 	// array of ASN1Object of PolicyQualifierInfo
    +878 	if (this.params.array !== undefined) {
    +879 	    var aPQI = [];
    +880 	    for (var i = 0; i < this.params.array.length; i++) {
    +881 		aPQI.push(new _PolicyQualifierInfo(this.params.array[i]));
    +882 	    }
    +883 	    if (aPQI.length > 0) {
    +884 		a.push(new _DERSequence({array: aPQI}));
    +885 	    }
    +886 	}
    +887 
    +888 	var seq = new _DERSequence({array: a});
    +889 	return seq.getEncodedHex();
    +890     };
    +891 
    +892     if (params !== undefined) {
    +893 	this.params = params;
    +894     }
    +895 };
    +896 YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation, KJUR.asn1.ASN1Object);
    +897 
    +898 /**
    +899  * PolicyQualifierInfo ASN.1 structure class
    +900  * @name KJUR.asn1.x509.PolicyQualifierInfo
    +901  * @class PolicyQualifierInfo ASN.1 structure class
    +902  * @param {Array} params associative array of parameters
    +903  * @extends KJUR.asn1.ASN1Object
    +904  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +905  * @description
    +906  * This class represents 
    +907  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +908  * PolicyQualifierInfo defined in RFC 5280 4.2.1.4</a>.
    +909  * <pre>
    +910  * PolicyQualifierInfo ::= SEQUENCE {
    +911  *      policyQualifierId  PolicyQualifierId,
    +912  *      qualifier          ANY DEFINED BY policyQualifierId }
    +913  * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    +914  * CPSuri ::= IA5String
    +915  * </pre>
    +916  * Its constructor can have one of following two parameters:
    +917  * <ul>
    +918  * <li>{String}cps - URI string for CPS</li>
    +919  * <li>{Object}unotice - {@link KJUR.asn1.x509.UserNotice} parameter</li>
    +920  * </ul>
    +921  * @example
    +922  * new PolicyQualifierInfo({
    +923  *   cps: "https://example.com/repository/cps"
    +924  * })
    +925  *
    +926  * new PolicyQualifierInfo({
    +927  *   unotice: {
    +928  *     noticeref: { // CA SHOULD NOT use this by RFC
    +929  *       org: {type: "bmp", str: "Sample Org"},
    +930  *       noticenum: [{int: 3}, {hex: "01af"}]
    +931  *     },
    +932  *     exptext: {type: "ia5", str: "Sample Policy"}
    +933  *   }
    +934  * })
    +935  */
    +936 KJUR.asn1.x509.PolicyQualifierInfo = function(params) {
    +937     KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,
    +938 								   params);
    +939     var _KJUR_asn1 = KJUR.asn1,
    +940 	_DERSequence = _KJUR_asn1.DERSequence,
    +941 	_DERIA5String = _KJUR_asn1.DERIA5String,
    +942 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +943 	_UserNotice = _KJUR_asn1.x509.UserNotice;
    +944 
    +945     this.params = null;
    +946 
    +947     this.getEncodedHex = function() {
    +948 	if (this.params.cps !== undefined) {
    +949 	    var seq = new _DERSequence({array: [
    +950 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.1'}),
    +951 		new _DERIA5String({str: this.params.cps})
    +952 	    ]});
    +953 	    return seq.getEncodedHex();
    +954 	}
    +955 	if (this.params.unotice != undefined) {
    +956 	    var seq = new _DERSequence({array: [
    +957 		new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.2'}),
    +958 		new _UserNotice(this.params.unotice)
    +959 	    ]});
    +960 	    return seq.getEncodedHex();
    +961 	}
    +962     };
    +963 
    +964     if (params !== undefined) {
    +965 	this.params = params;
    +966     }
    +967 };
    +968 YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo, KJUR.asn1.ASN1Object);
    +969 
    +970 
    +971 /**
    +972  * UserNotice ASN.1 structure class
    +973  * @name KJUR.asn1.x509.UserNotice
    +974  * @class UserNotice ASN.1 structure class
    +975  * @param {Array} params associative array of parameters
    +976  * @extends KJUR.asn1.ASN1Object
    +977  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +978  * @description
    +979  * This class represents 
    +980  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +981  * UserNotice defined in RFC 5280 4.2.1.4</a>.
    +982  * <pre>
    +983  * UserNotice ::= SEQUENCE {
    +984  *      noticeRef        NoticeReference OPTIONAL,
    +985  *      explicitText     DisplayText OPTIONAL }
    +986  * </pre>
    +987  * Its constructor can have following two parameters:
    +988  * <ul>
    +989  * <li>{Object}noticeref - {@link KJUR.asn1.x509.NoticeReference} parameter.
    +990  * This SHALL NOT be set for conforming CA by RFC 5280. (OPTIONAL)</li>
    +991  * <li>{Object}exptext - explicitText value
    +992  * by {@link KJUR.asn1.x509.DisplayText} parameter (OPTIONAL)</li>
    +993  * </ul>
    +994  * @example
    +995  * new UserNotice({
    +996  *   noticeref: {
    +997  *     org: {type: "bmp", str: "Sample Org"},
    +998  *     noticenum: [{int: 3}, {hex: "01af"}]
    +999  *   },
    +1000  *   exptext: {type: "ia5", str: "Sample Policy"}
    +1001  * })
    +1002  */
    +1003 KJUR.asn1.x509.UserNotice = function(params) {
    +1004     KJUR.asn1.x509.UserNotice.superclass.constructor.call(this, params);
    +1005     var _DERSequence = KJUR.asn1.DERSequence,
    +1006 	_DERInteger = KJUR.asn1.DERInteger,
    +1007 	_DisplayText = KJUR.asn1.x509.DisplayText,
    +1008 	_NoticeReference = KJUR.asn1.x509.NoticeReference;
    +1009 
    +1010     this.params = null;
    +1011 
    +1012     this.getEncodedHex = function() {
    +1013 	var a = [];
    +1014 	if (this.params.noticeref !== undefined) {
    +1015 	    a.push(new _NoticeReference(this.params.noticeref));
    +1016 	}
    +1017 	if (this.params.exptext !== undefined) {
    +1018 	    a.push(new _DisplayText(this.params.exptext));
    +1019 	}
    +1020 	var seq = new _DERSequence({array: a});
    +1021 	return seq.getEncodedHex();
    +1022     };
    +1023 
    +1024     if (params !== undefined) {
    +1025 	this.params = params;
    +1026     }
    +1027 };
    +1028 YAHOO.lang.extend(KJUR.asn1.x509.UserNotice, KJUR.asn1.ASN1Object);
    +1029 
    +1030 /**
    +1031  * NoticeReference ASN.1 structure class
    +1032  * @name KJUR.asn1.x509.NoticeReference
    +1033  * @class NoticeReference ASN.1 structure class
    +1034  * @param {Array} params associative array of parameters
    +1035  * @extends KJUR.asn1.ASN1Object
    +1036  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1037  * @description
    +1038  * This class represents 
    +1039  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1040  * NoticeReference defined in RFC 5280 4.2.1.4</a>.
    +1041  * <pre>
    +1042  * NoticeReference ::= SEQUENCE {
    +1043  *      organization     DisplayText,
    +1044  *      noticeNumbers    SEQUENCE OF INTEGER }
    +1045  * </pre>
    +1046  * Its constructor can have following two parameters:
    +1047  * <ul>
    +1048  * <li>{Object}org - organization by {@link KJUR.asn1.x509.DisplayText}
    +1049  * parameter.</li>
    +1050  * <li>{Object}noticenum - noticeNumbers value by an array of
    +1051  * {@link KJUR.asn1.DERInteger} parameter</li>
    +1052  * </ul>
    +1053  * @example
    +1054  * new NoticeReference({
    +1055  *   org: {type: "bmp", str: "Sample Org"},
    +1056  *   noticenum: [{int: 3}, {hex: "01af"}]
    +1057  * })
    +1058  */
    +1059 KJUR.asn1.x509.NoticeReference = function(params) {
    +1060     KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this, params);
    +1061     var _DERSequence = KJUR.asn1.DERSequence,
    +1062 	_DERInteger = KJUR.asn1.DERInteger,
    +1063 	_DisplayText = KJUR.asn1.x509.DisplayText;
    +1064 
    +1065     this.params = null;
    +1066 
    +1067     this.getEncodedHex = function() {
    +1068 	var a = [];
    +1069 	if (this.params.org !== undefined) {
    +1070 	    a.push(new _DisplayText(this.params.org));
    +1071 	}
    +1072 	if (this.params.noticenum !== undefined) {
    +1073 	    var aNoticeNum = [];
    +1074 	    var aNumParam = this.params.noticenum;
    +1075 	    for (var i = 0; i < aNumParam.length; i++) {
    +1076 		aNoticeNum.push(new _DERInteger(aNumParam[i]));
    +1077 	    }
    +1078 	    a.push(new _DERSequence({array: aNoticeNum}));
    +1079 	}
    +1080 	if (a.length == 0) throw new Error("parameter is empty");
    +1081 	var seq = new _DERSequence({array: a});
    +1082 	return seq.getEncodedHex();
    +1083     }
    +1084 
    +1085     if (params !== undefined) {
    +1086 	this.params = params;
    +1087     }
    +1088 };
    +1089 YAHOO.lang.extend(KJUR.asn1.x509.NoticeReference, KJUR.asn1.ASN1Object);
    +1090 
    +1091 /**
    +1092  * DisplayText ASN.1 structure class
    +1093  * @name KJUR.asn1.x509.DisplayText
    +1094  * @class DisplayText ASN.1 structure class
    +1095  * @param {Array} params associative array of parameters
    +1096  * @extends KJUR.asn1.DERAbstractString
    +1097  * @since jsrsasign 8.0.23 asn1x509 1.1.12
    +1098  * @description
    +1099  * This class represents 
    +1100  * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">
    +1101  * DisplayText defined in RFC 5280 4.2.1.4</a>.
    +1102  * <pre>
    +1103  * -- from RFC 5280 Appendix A
    +1104  * DisplayText ::= CHOICE {
    +1105  *      ia5String        IA5String      (SIZE (1..200)),
    +1106  *      visibleString    VisibleString  (SIZE (1..200)),
    +1107  *      bmpString        BMPString      (SIZE (1..200)),
    +1108  *      utf8String       UTF8String     (SIZE (1..200)) }
    +1109  * </pre>
    +1110  * {@link KJUR.asn1.DERAbstractString} parameters and methods
    +1111  * can be used.
    +1112  * Its constructor can also have following parameter:
    +1113  * <ul>
    +1114  * <li>{String} type - DirectoryString type of DisplayText.
    +1115  * "ia5" for IA5String, "vis" for VisibleString,
    +1116  * "bmp" for BMPString and "utf8" for UTF8String.
    +1117  * Default is "utf8". (OPTIONAL)</li>
    +1118  * </ul>
    +1119  * @example
    +1120  * new DisplayText({type: "bmp", str: "Sample Org"})
    +1121  * new DisplayText({type: "ia5", str: "Sample Org"})
    +1122  * new DisplayText({str: "Sample Org"})
    +1123  */
    +1124 KJUR.asn1.x509.DisplayText = function(params) {
    +1125     KJUR.asn1.x509.DisplayText.superclass.constructor.call(this, params);
    +1126 
    +1127     this.hT = "0c"; // DEFAULT "utf8"
    +1128 
    +1129     if (params !== undefined) {
    +1130 	if (params.type === "ia5") {
    +1131 	    this.hT = "16";
    +1132 	} else if (params.type === "vis") {
    +1133 	    this.hT = "1a";
    +1134 	} else if (params.type === "bmp") {
    +1135 	    this.hT = "1e";
    +1136 	}
    +1137     }
    +1138 };
    +1139 YAHOO.lang.extend(KJUR.asn1.x509.DisplayText, KJUR.asn1.DERAbstractString);
    +1140 
    +1141 // =====================================================================
    +1142 /**
    +1143  * KeyUsage ASN.1 structure class
    +1144  * @name KJUR.asn1.x509.ExtKeyUsage
    +1145  * @class ExtKeyUsage ASN.1 structure class
    +1146  * @param {Array} params associative array of parameters
    +1147  * @extends KJUR.asn1.x509.Extension
    +1148  * @description
    +1149  * @example
    +1150  * e1 = new KJUR.asn1.x509.ExtKeyUsage({
    +1151  *   critical: true,
    +1152  *   array: [
    +1153  *     {oid: '2.5.29.37.0'},  // anyExtendedKeyUsage
    +1154  *     {name: 'clientAuth'}
    +1155  *   ]
    +1156  * });
    +1157  * // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
    +1158  * // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
    +1159  * // KeyPurposeId ::= OBJECT IDENTIFIER
    +1160  */
    +1161 KJUR.asn1.x509.ExtKeyUsage = function(params) {
    +1162     KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this, params);
    +1163     var _KJUR = KJUR,
    +1164 	_KJUR_asn1 = _KJUR.asn1;
    +1165 
    +1166     this.setPurposeArray = function(purposeArray) {
    +1167         this.asn1ExtnValue = new _KJUR_asn1.DERSequence();
    +1168         for (var i = 0; i < purposeArray.length; i++) {
    +1169             var o = new _KJUR_asn1.DERObjectIdentifier(purposeArray[i]);
    +1170             this.asn1ExtnValue.appendASN1Object(o);
    +1171         }
    +1172     };
    +1173 
    +1174     this.getExtnValueHex = function() {
    +1175         return this.asn1ExtnValue.getEncodedHex();
    +1176     };
    +1177 
    +1178     this.oid = "2.5.29.37";
    +1179     if (params !== undefined) {
    +1180         if (params.array !== undefined) {
    +1181             this.setPurposeArray(params.array);
    +1182         }
    +1183     }
    +1184 };
    +1185 YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage, KJUR.asn1.x509.Extension);
    +1186 
    +1187 /**
    +1188  * AuthorityKeyIdentifier ASN.1 structure class
    +1189  * @name KJUR.asn1.x509.AuthorityKeyIdentifier
    +1190  * @class AuthorityKeyIdentifier ASN.1 structure class
    +1191  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    +1192  * @extends KJUR.asn1.x509.Extension
    +1193  * @since asn1x509 1.0.8
    +1194  * @description
    +1195  * 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>.
    +1196  * Constructor of this class may have following parameters.: 
    +1197  * <ul>
    +1198  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of authority public key or authcertificate 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>
    +1199  * <li>isscert - When PEM string of authority certificate is specified, both authorityCertIssuer and authorityCertSerialNumber will be set by the certificate.</li>
    +1200  * <li>issuer - {@link KJUR.asn1.x509.X500Name} parameter to specify issuer name explicitly.</li>
    +1201  * <li>sn - hexadecimal string to specify serial number explicitly.</li>
    +1202  * <li>critical - boolean to specify criticality of this extension
    +1203  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    +1204  * </ul>
    +1205  * 
    +1206  * <pre>
    +1207  * d-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
    +1208  * AuthorityKeyIdentifier ::= SEQUENCE {
    +1209  *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
    +1210  *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
    +1211  *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
    +1212  * KeyIdentifier ::= OCTET STRING
    +1213  * </pre>
    +1214  *
    +1215  * @example
    +1216  * // 1. kid by key object
    +1217  * keyobj = KEYUTIL.getKey("-----BEGIN PUBLIC KEY...");
    +1218  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: keyobj});
    +1219  * // 2. kid by PEM string of authority certificate or public key
    +1220  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "-----BEGIN..."});
    +1221  * // 3. specify kid explicitly
    +1222  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({kid: "8ab1d3..."});
    +1223  * });
    +1224  * // 4. issuer and serial number by auhtority PEM certificate
    +1225  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({isscert: "-----BEGIN..."});
    +1226  * // 5. issuer and serial number explicitly
    +1227  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    +1228  *   issuer: {ldapstr: "O=test,C=US"},
    +1229  *   sn: {hex: "1ac7..."}});
    +1230  * // 6. combination
    +1231  * e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier({
    +1232  *   kid: "-----BEGIN CERTIFICATE...",
    +1233  *   isscert: "-----BEGIN CERTIFICATE..."});
    +1234  */
    +1235 KJUR.asn1.x509.AuthorityKeyIdentifier = function(params) {
    +1236     KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this, params);
    +1237     var _KJUR = KJUR,
    +1238 	_KJUR_asn1 = _KJUR.asn1,
    +1239 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +1240 	_GeneralNames = _KJUR_asn1.x509.GeneralNames,
    +1241 	_isKey = _KJUR.crypto.Util.isKey;
    +1242 
    +1243     this.asn1KID = null;
    +1244     this.asn1CertIssuer = null; // X500Name hTLV
    +1245     this.asn1CertSN = null;
    +1246 
    +1247     this.getExtnValueHex = function() {
    +1248         var a = new Array();
    +1249         if (this.asn1KID)
    +1250             a.push(new _DERTaggedObject({'explicit': false,
    +1251                                          'tag': '80',
    +1252                                          'obj': this.asn1KID}));
    +1253 
    +1254         if (this.asn1CertIssuer)
    +1255             a.push(new _DERTaggedObject({'explicit': false,
    +1256                                          'tag': 'a1',
    +1257                                          'obj': new _GeneralNames([{dn: this.asn1CertIssuer}])}));
     1258 
    -1259     this.oid = "2.5.29.17";
    -1260     if (params !== undefined) {
    -1261         if (params.array !== undefined) {
    -1262             this.setNameArray(params.array);
    -1263         }
    -1264     }
    -1265 };
    -1266 YAHOO.lang.extend(KJUR.asn1.x509.SubjectAltName, KJUR.asn1.x509.Extension);
    -1267 
    -1268 /**
    -1269  * IssuerAltName ASN.1 structure class<br/>
    -1270  * @name KJUR.asn1.x509.IssuerAltName
    -1271  * @class IssuerAltName ASN.1 structure class
    -1272  * @param {Array} params associative array of parameters
    -1273  * @extends KJUR.asn1.x509.Extension
    -1274  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    -1275  * @see KJUR.asn1.x509.GeneralNames
    -1276  * @see KJUR.asn1.x509.GeneralName
    -1277  * @description
    -1278  * This class provides X.509v3 IssuerAltName extension.
    -1279  * <pre>
    -1280  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 18 }
    -1281  * IssuerAltName ::= GeneralNames
    -1282  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -1283  * GeneralName ::= CHOICE {
    -1284  *   otherName                  [0] OtherName,
    -1285  *   rfc822Name                 [1] IA5String,
    -1286  *   dNSName                    [2] IA5String,
    -1287  *   x400Address                [3] ORAddress,
    -1288  *   directoryName              [4] Name,
    -1289  *   ediPartyName               [5] EDIPartyName,
    -1290  *   uniformResourceIdentifier  [6] IA5String,
    -1291  *   iPAddress                  [7] OCTET STRING,
    -1292  *   registeredID               [8] OBJECT IDENTIFIER }
    -1293  * </pre>
    -1294  * @example
    -1295  * e1 = new KJUR.asn1.x509.IssuerAltName({
    -1296  *   critical: true,
    -1297  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    -1298  * });
    -1299  */
    -1300 KJUR.asn1.x509.IssuerAltName = function(params) {
    -1301     KJUR.asn1.x509.IssuerAltName.superclass.constructor.call(this, params)
    -1302 
    -1303     this.setNameArray = function(paramsArray) {
    -1304 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    -1305     };
    -1306 
    -1307     this.getExtnValueHex = function() {
    -1308         return this.asn1ExtnValue.getEncodedHex();
    -1309     };
    -1310 
    -1311     this.oid = "2.5.29.18";
    -1312     if (params !== undefined) {
    -1313         if (params.array !== undefined) {
    -1314             this.setNameArray(params.array);
    -1315         }
    -1316     }
    -1317 };
    -1318 YAHOO.lang.extend(KJUR.asn1.x509.IssuerAltName, KJUR.asn1.x509.Extension);
    -1319 
    -1320 // === END   X.509v3 Extensions Related =======================================
    +1259         if (this.asn1CertSN)
    +1260             a.push(new _DERTaggedObject({'explicit': false,
    +1261                                          'tag': '82',
    +1262                                          'obj': this.asn1CertSN}));
    +1263 
    +1264         var asn1Seq = new _KJUR_asn1.DERSequence({'array': a});
    +1265         this.asn1ExtnValue = asn1Seq;
    +1266         return this.asn1ExtnValue.getEncodedHex();
    +1267     };
    +1268 
    +1269     /**
    +1270      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    +1271      * @name setKIDByParam
    +1272      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1273      * @function
    +1274      * @param {Array} param parameter to set key identifier
    +1275      * @since asn1x509 1.0.8
    +1276      * @description
    +1277      * This method will set keyIdentifier by param.
    +1278      * Its key identifier value can be set by following type of param argument:
    +1279      * <ul>
    +1280      * <li>{str: "123"} - by raw string</li>
    +1281      * <li>{hex: "01af..."} - by hexadecimal value</li>
    +1282      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    +1283      * key identifier value will be calculated by the method described in
    +1284      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1285      * </li>
    +1286      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    +1287      * certificate and
    +1288      * key identifier value will be calculated by the method described in
    +1289      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1290      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    +1291      * to PKCS#8 ASN.1 structure then calculate 
    +1292      * a key identifier value will be calculated by the method described in
    +1293      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1294      * </ul>
    +1295      *
    +1296      * NOTE1: Automatic key identifier calculation is supported
    +1297      * since jsrsasign 8.0.16.
    +1298      *
    +1299      * @see KEYUTIL.getKeyID
    +1300      * 
    +1301      * @example
    +1302      * o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    +1303      * // set by hexadecimal string
    +1304      * o.setKIDByParam({hex: '1ad9...'});
    +1305      * // set by SubjectPublicKeyInfo of PEM certificate string
    +1306      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    +1307      * // set by PKCS#8 PEM public key string
    +1308      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    +1309      * // set by public key object
    +1310      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1311      * o.setKIDByParam(pubkey);
    +1312      */
    +1313     this.setKIDByParam = function(param) {
    +1314 	if (param.str !== undefined ||
    +1315 	    param.hex !== undefined) {
    +1316 	    this.asn1KID = new KJUR.asn1.DEROctetString(param);
    +1317 	} else if ((typeof param === "object" &&
    +1318 		    KJUR.crypto.Util.isKey(param)) ||
    +1319 		   (typeof param === "string" &&
    +1320 		    param.indexOf("BEGIN ") != -1)) {
     1321 
    -1322 // === BEGIN CRL Related ===================================================
    -1323 /**
    -1324  * X.509 CRL class to sign and generate hex encoded CRL
    -1325  * @name KJUR.asn1.x509.CRL
    -1326  * @class X.509 CRL class to sign and generate hex encoded certificate
    -1327  * @param {Array} params associative array of parameters (ex. {'tbsobj': obj, 'rsaprvkey': key})
    -1328  * @extends KJUR.asn1.ASN1Object
    -1329  * @since 1.0.3
    -1330  * @description
    -1331  * <br/>
    -1332  * As for argument 'params' for constructor, you can specify one of
    -1333  * following properties:
    -1334  * <ul>
    -1335  * <li>tbsobj - specify {@link KJUR.asn1.x509.TBSCertList} object to be signed</li>
    -1336  * <li>rsaprvkey - specify {@link RSAKey} object CA private key</li>
    -1337  * </ul>
    -1338  * NOTE: 'params' can be omitted.
    -1339  * <h4>EXAMPLE</h4>
    -1340  * @example
    -1341  * var prvKey = KEYUTIL.getKEY("-----BEGIN PRIVATE..."); // CA's private key
    -1342  * var crl = new KJUR.asn1x509.CRL({'tbsobj': tbs, 'prvkeyobj': prvKey});
    -1343  * crl.sign(); // issue CRL by CA's private key
    -1344  * var hCRL = crl.getEncodedHex();
    -1345  *
    -1346  * // CertificateList  ::=  SEQUENCE  {
    -1347  * //     tbsCertList          TBSCertList,
    -1348  * //     signatureAlgorithm   AlgorithmIdentifier,
    -1349  * //     signatureValue       BIT STRING  }
    -1350  */
    -1351 KJUR.asn1.x509.CRL = function(params) {
    -1352     KJUR.asn1.x509.CRL.superclass.constructor.call(this);
    -1353 
    -1354     var asn1TBSCertList = null,
    -1355 	asn1SignatureAlg = null,
    -1356 	asn1Sig = null,
    -1357 	hexSig = null,
    -1358 	prvKey = null;
    -1359 
    -1360     /**
    -1361      * sign TBSCertList and set signature value internally
    -1362      * @name sign
    -1363      * @memberOf KJUR.asn1.x509.CRL#
    -1364      * @function
    -1365      * @description
    -1366      * @example
    -1367      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'prvkeyobj': prvKey});
    -1368      * cert.sign();
    -1369      */
    -1370     this.sign = function() {
    -1371         this.asn1SignatureAlg = this.asn1TBSCertList.asn1SignatureAlg;
    -1372 
    -1373         sig = new KJUR.crypto.Signature({'alg': this.asn1SignatureAlg.nameAlg, 'prov': 'cryptojs/jsrsa'});
    -1374         sig.init(this.prvKey);
    -1375         sig.updateHex(this.asn1TBSCertList.getEncodedHex());
    -1376         this.hexSig = sig.sign();
    +1322 	    var keyobj = param;
    +1323 	    if (typeof param === "string") {
    +1324 		keyobj = KEYUTIL.getKey(param);
    +1325 	    }
    +1326 
    +1327 	    var kid = KEYUTIL.getKeyID(keyobj);
    +1328 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    +1329 	}
    +1330     };
    +1331 
    +1332     /**
    +1333      * set authorityCertIssuer value by X500Name parameter
    +1334      * @name setCertIssuerByParam
    +1335      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1336      * @function
    +1337      * @param {Array} param parameter to set issuer name
    +1338      * @since asn1x509 1.0.8
    +1339      * @description
    +1340      * This method will set authorityCertIssuer name by param.
    +1341      * Issuer name can be set by following type of param argument:
    +1342      * <ul>
    +1343      * <li>str/ldapstr/hex/certsubject/certissuer - 
    +1344      * set issuer by {@link KJUR.asn1.x509.X500Name}
    +1345      * object with specified parameters.</li>
    +1346      * <li>PEM CERTIFICATE STRING - extract its subject name from 
    +1347      * specified issuer PEM certificate and set.
    +1348      * </ul>
    +1349      * NOTE1: Automatic authorityCertIssuer setting by certificate
    +1350      * is supported since jsrsasign 8.0.16.
    +1351      *
    +1352      * @see KJUR.asn1.x509.X500Name
    +1353      * @see KJUR.asn1.x509.GeneralNames
    +1354      * @see X509.getSubjectHex
    +1355      *
    +1356      * @example
    +1357      * var o = new KJUR.asn1.x509.AuthorityKeyIdentifier();
    +1358      * // 1. set it by string
    +1359      * o.setCertIssuerByParam({str: '/C=US/O=Test'});
    +1360      * // 2. set it by issuer PEM certificate
    +1361      * o.setCertIssuerByParam("-----BEGIN CERTIFICATE...");
    +1362      *
    +1363      */
    +1364     this.setCertIssuerByParam = function(param) {
    +1365 	if (param.str !== undefined ||
    +1366 	    param.ldapstr !== undefined ||
    +1367 	    param.hex !== undefined ||
    +1368 	    param.certsubject !== undefined ||
    +1369 	    param.certissuer !== undefined) {
    +1370             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name(param);
    +1371 	} else if (typeof param === "string" &&
    +1372 		   param.indexOf("BEGIN ") != -1 &&
    +1373 		   param.indexOf("CERTIFICATE") != -1) {
    +1374             this.asn1CertIssuer = new KJUR.asn1.x509.X500Name({certissuer: param});
    +1375 	}
    +1376     };
     1377 
    -1378         this.asn1Sig = new KJUR.asn1.DERBitString({'hex': '00' + this.hexSig});
    -1379 
    -1380         var seq = new KJUR.asn1.DERSequence({'array': [this.asn1TBSCertList,
    -1381                                                        this.asn1SignatureAlg,
    -1382                                                        this.asn1Sig]});
    -1383         this.hTLV = seq.getEncodedHex();
    -1384         this.isModified = false;
    -1385     };
    -1386 
    -1387     this.getEncodedHex = function() {
    -1388         if (this.isModified == false && this.hTLV != null) return this.hTLV;
    -1389         throw "not signed yet";
    -1390     };
    -1391 
    -1392     /**
    -1393      * get PEM formatted CRL string after signed
    -1394      * @name getPEMString
    -1395      * @memberOf KJUR.asn1.x509.CRL#
    -1396      * @function
    -1397      * @return PEM formatted string of certificate
    -1398      * @description
    -1399      * @example
    -1400      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'rsaprvkey': prvKey});
    -1401      * cert.sign();
    -1402      * var sPEM =  cert.getPEMString();
    -1403      */
    -1404     this.getPEMString = function() {
    -1405         var pemBody = hextob64nl(this.getEncodedHex());
    -1406         return "-----BEGIN X509 CRL-----\r\n" + 
    -1407 	    pemBody + 
    -1408 	    "\r\n-----END X509 CRL-----\r\n";
    -1409     };
    -1410 
    -1411     if (params !== undefined) {
    -1412         if (params.tbsobj !== undefined) {
    -1413             this.asn1TBSCertList = params.tbsobj;
    -1414         }
    -1415         if (params.prvkeyobj !== undefined) {
    -1416             this.prvKey = params.prvkeyobj;
    -1417         }
    -1418     }
    -1419 };
    -1420 YAHOO.lang.extend(KJUR.asn1.x509.CRL, KJUR.asn1.ASN1Object);
    -1421 
    -1422 /**
    -1423  * ASN.1 TBSCertList structure class for CRL
    -1424  * @name KJUR.asn1.x509.TBSCertList
    -1425  * @class ASN.1 TBSCertList structure class for CRL
    -1426  * @param {Array} params associative array of parameters (ex. {})
    -1427  * @extends KJUR.asn1.ASN1Object
    -1428  * @since 1.0.3
    -1429  * @description
    -1430  * <br/>
    -1431  * <h4>EXAMPLE</h4>
    -1432  * @example
    -1433  *  var o = new KJUR.asn1.x509.TBSCertList();
    -1434  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    -1435  *  o.setIssuerByParam({'str': '/C=US/O=a'});
    -1436  *  o.setNotThisUpdateByParam({'str': '130504235959Z'});
    -1437  *  o.setNotNextUpdateByParam({'str': '140504235959Z'});
    -1438  *  o.addRevokedCert({'int': 4}, {'str':'130514235959Z'}));
    -1439  *  o.addRevokedCert({'hex': '0f34dd'}, {'str':'130514235959Z'}));
    -1440  *
    -1441  * // TBSCertList  ::=  SEQUENCE  {
    -1442  * //        version                 Version OPTIONAL,
    -1443  * //                                     -- if present, MUST be v2
    -1444  * //        signature               AlgorithmIdentifier,
    -1445  * //        issuer                  Name,
    -1446  * //        thisUpdate              Time,
    -1447  * //        nextUpdate              Time OPTIONAL,
    -1448  * //        revokedCertificates     SEQUENCE OF SEQUENCE  {
    -1449  * //             userCertificate         CertificateSerialNumber,
    -1450  * //             revocationDate          Time,
    -1451  * //             crlEntryExtensions      Extensions OPTIONAL
    -1452  * //                                      -- if present, version MUST be v2
    -1453  * //                                  }  OPTIONAL,
    -1454  * //        crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    -1455  */
    -1456 KJUR.asn1.x509.TBSCertList = function(params) {
    -1457     KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);
    -1458     var aRevokedCert = null,
    -1459 	_KJUR = KJUR,
    -1460 	_KJUR_asn1 = _KJUR.asn1,
    -1461 	_DERSequence = _KJUR_asn1.DERSequence,
    -1462 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -1463 	_Time = _KJUR_asn1_x509.Time;
    -1464 
    -1465     /**
    -1466      * set signature algorithm field by parameter
    -1467      * @name setSignatureAlgByParam
    -1468      * @memberOf KJUR.asn1.x509.TBSCertList#
    -1469      * @function
    -1470      * @param {Array} algIdParam AlgorithmIdentifier parameter
    -1471      * @description
    -1472      * @example
    -1473      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    -1474      */
    -1475     this.setSignatureAlgByParam = function(algIdParam) {
    -1476         this.asn1SignatureAlg = 
    -1477 	    new _KJUR_asn1_x509.AlgorithmIdentifier(algIdParam);
    -1478     };
    -1479 
    -1480     /**
    -1481      * set issuer name field by parameter
    -1482      * @name setIssuerByParam
    -1483      * @memberOf KJUR.asn1.x509.TBSCertList#
    -1484      * @function
    -1485      * @param {Array} x500NameParam X500Name parameter
    -1486      * @description
    -1487      * @example
    -1488      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
    -1489      * @see KJUR.asn1.x509.X500Name
    -1490      */
    -1491     this.setIssuerByParam = function(x500NameParam) {
    -1492         this.asn1Issuer = new _KJUR_asn1_x509.X500Name(x500NameParam);
    -1493     };
    -1494 
    -1495     /**
    -1496      * set thisUpdate field by parameter
    -1497      * @name setThisUpdateByParam
    -1498      * @memberOf KJUR.asn1.x509.TBSCertList#
    -1499      * @function
    -1500      * @param {Array} timeParam Time parameter
    -1501      * @description
    -1502      * @example
    -1503      * tbsc.setThisUpdateByParam({'str': '130508235959Z'});
    -1504      * @see KJUR.asn1.x509.Time
    -1505      */
    -1506     this.setThisUpdateByParam = function(timeParam) {
    -1507         this.asn1ThisUpdate = new _Time(timeParam);
    -1508     };
    -1509 
    -1510     /**
    -1511      * set nextUpdate field by parameter
    -1512      * @name setNextUpdateByParam
    -1513      * @memberOf KJUR.asn1.x509.TBSCertList#
    -1514      * @function
    -1515      * @param {Array} timeParam Time parameter
    -1516      * @description
    -1517      * @example
    -1518      * tbsc.setNextUpdateByParam({'str': '130508235959Z'});
    -1519      * @see KJUR.asn1.x509.Time
    -1520      */
    -1521     this.setNextUpdateByParam = function(timeParam) {
    -1522         this.asn1NextUpdate = new _Time(timeParam);
    -1523     };
    -1524 
    -1525     /**
    -1526      * add revoked certificate by parameter
    -1527      * @name addRevokedCert
    -1528      * @memberOf KJUR.asn1.x509.TBSCertList#
    -1529      * @function
    -1530      * @param {Array} snParam DERInteger parameter for certificate serial number
    -1531      * @param {Array} timeParam Time parameter for revocation date
    -1532      * @description
    -1533      * @example
    -1534      * tbsc.addRevokedCert({'int': 3}, {'str': '130508235959Z'});
    -1535      * @see KJUR.asn1.x509.Time
    -1536      */
    -1537     this.addRevokedCert = function(snParam, timeParam) {
    -1538         var param = {};
    -1539         if (snParam != undefined && snParam != null)
    -1540 	    param['sn'] = snParam;
    -1541         if (timeParam != undefined && timeParam != null)
    -1542 	    param['time'] = timeParam;
    -1543         var o = new _KJUR_asn1_x509.CRLEntry(param);
    -1544         this.aRevokedCert.push(o);
    -1545     };
    -1546 
    -1547     this.getEncodedHex = function() {
    -1548         this.asn1Array = new Array();
    -1549 
    -1550         if (this.asn1Version != null) this.asn1Array.push(this.asn1Version);
    -1551         this.asn1Array.push(this.asn1SignatureAlg);
    -1552         this.asn1Array.push(this.asn1Issuer);
    -1553         this.asn1Array.push(this.asn1ThisUpdate);
    -1554         if (this.asn1NextUpdate != null) this.asn1Array.push(this.asn1NextUpdate);
    -1555 
    -1556         if (this.aRevokedCert.length > 0) {
    -1557             var seq = new _DERSequence({'array': this.aRevokedCert});
    -1558             this.asn1Array.push(seq);
    -1559         }
    -1560 
    -1561         var o = new _DERSequence({"array": this.asn1Array});
    -1562         this.hTLV = o.getEncodedHex();
    -1563         this.isModified = false;
    -1564         return this.hTLV;
    -1565     };
    -1566 
    -1567     this._initialize = function() {
    -1568         this.asn1Version = null;
    -1569         this.asn1SignatureAlg = null;
    -1570         this.asn1Issuer = null;
    -1571         this.asn1ThisUpdate = null;
    -1572         this.asn1NextUpdate = null;
    -1573         this.aRevokedCert = new Array();
    -1574     };
    -1575 
    -1576     this._initialize();
    -1577 };
    -1578 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList, KJUR.asn1.ASN1Object);
    -1579 
    -1580 /**
    -1581  * ASN.1 CRLEntry structure class for CRL
    -1582  * @name KJUR.asn1.x509.CRLEntry
    -1583  * @class ASN.1 CRLEntry structure class for CRL
    -1584  * @param {Array} params associative array of parameters (ex. {})
    -1585  * @extends KJUR.asn1.ASN1Object
    -1586  * @since 1.0.3
    -1587  * @description
    -1588  * @example
    -1589  * var e = new KJUR.asn1.x509.CRLEntry({'time': {'str': '130514235959Z'}, 'sn': {'int': 234}});
    -1590  *
    -1591  * // revokedCertificates     SEQUENCE OF SEQUENCE  {
    -1592  * //     userCertificate         CertificateSerialNumber,
    -1593  * //     revocationDate          Time,
    -1594  * //     crlEntryExtensions      Extensions OPTIONAL
    -1595  * //                             -- if present, version MUST be v2 }
    -1596  */
    -1597 KJUR.asn1.x509.CRLEntry = function(params) {
    -1598     KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);
    -1599     var sn = null,
    -1600 	time = null,
    -1601 	_KJUR = KJUR,
    -1602 	_KJUR_asn1 = _KJUR.asn1;
    -1603 
    -1604     /**
    -1605      * set DERInteger parameter for serial number of revoked certificate
    -1606      * @name setCertSerial
    -1607      * @memberOf KJUR.asn1.x509.CRLEntry
    -1608      * @function
    -1609      * @param {Array} intParam DERInteger parameter for certificate serial number
    -1610      * @description
    -1611      * @example
    -1612      * entry.setCertSerial({'int': 3});
    -1613      */
    -1614     this.setCertSerial = function(intParam) {
    -1615         this.sn = new _KJUR_asn1.DERInteger(intParam);
    -1616     };
    -1617 
    -1618     /**
    -1619      * set Time parameter for revocation date
    -1620      * @name setRevocationDate
    -1621      * @memberOf KJUR.asn1.x509.CRLEntry
    -1622      * @function
    -1623      * @param {Array} timeParam Time parameter for revocation date
    -1624      * @description
    -1625      * @example
    -1626      * entry.setRevocationDate({'str': '130508235959Z'});
    -1627      */
    -1628     this.setRevocationDate = function(timeParam) {
    -1629         this.time = new _KJUR_asn1.x509.Time(timeParam);
    -1630     };
    -1631 
    -1632     this.getEncodedHex = function() {
    -1633         var o = new _KJUR_asn1.DERSequence({"array": [this.sn, this.time]});
    -1634         this.TLV = o.getEncodedHex();
    -1635         return this.TLV;
    -1636     };
    -1637 
    -1638     if (params !== undefined) {
    -1639         if (params.time !== undefined) {
    -1640             this.setRevocationDate(params.time);
    -1641         }
    -1642         if (params.sn !== undefined) {
    -1643             this.setCertSerial(params.sn);
    -1644         }
    -1645     }
    -1646 };
    -1647 YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry, KJUR.asn1.ASN1Object);
    -1648 
    -1649 // === END   CRL Related ===================================================
    +1378     /**
    +1379      * set authorityCertSerialNumber value
    +1380      * @name setCertSerialNumberByParam
    +1381      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier#
    +1382      * @function
    +1383      * @param {Object} param parameter to set serial number
    +1384      * @since asn1x509 1.0.8
    +1385      * @description
    +1386      * This method will set authorityCertSerialNumber by param.
    +1387      * Serial number can be set by following type of param argument:
    +1388      *
    +1389      * <ul>
    +1390      * <li>{int: 123} - by integer value</li>
    +1391      * <li>{hex: "01af"} - by hexadecimal integer value</li>
    +1392      * <li>{bigint: new BigInteger(...)} - by hexadecimal integer value</li>
    +1393      * <li>PEM CERTIFICATE STRING - extract serial number from issuer certificate and
    +1394      * set serial number.
    +1395      * 
    +1396      * NOTE1: Automatic authorityCertSerialNumber setting by certificate
    +1397      * is supported since jsrsasign 8.0.16.
    +1398      *
    +1399      * @see X509.getSerialNumberHex
    +1400      */
    +1401     this.setCertSNByParam = function(param) {
    +1402 	if (param.str !== undefined ||
    +1403 	    param.bigint !== undefined ||
    +1404 	    param.hex !== undefined) {
    +1405             this.asn1CertSN = new KJUR.asn1.DERInteger(param);
    +1406 	} else if (typeof param === "string" &&
    +1407 		   param.indexOf("BEGIN ") != -1 &&
    +1408 		   param.indexOf("CERTIFICATE")) {
    +1409 
    +1410             var x = new X509();
    +1411             x.readCertPEM(param);
    +1412 	    var sn = x.getSerialNumberHex();
    +1413 	    this.asn1CertSN = new KJUR.asn1.DERInteger({hex: sn});
    +1414 	}
    +1415     };
    +1416 
    +1417     this.oid = "2.5.29.35";
    +1418     if (params !== undefined) {
    +1419         if (params.kid !== undefined) {
    +1420             this.setKIDByParam(params.kid);
    +1421         }
    +1422         if (params.issuer !== undefined) {
    +1423             this.setCertIssuerByParam(params.issuer);
    +1424         }
    +1425         if (params.sn !== undefined) {
    +1426             this.setCertSNByParam(params.sn);
    +1427         }
    +1428 
    +1429 	if (params.issuersn !== undefined &&
    +1430 	    typeof params.issuersn === "string" &&
    +1431 	    params.issuersn.indexOf("BEGIN ") != -1 &&
    +1432 	    params.issuersn.indexOf("CERTIFICATE")) {
    +1433 	    this.setCertSNByParam(params.issuersn);
    +1434 	    this.setCertIssuerByParam(params.issuersn);
    +1435 	}
    +1436     }
    +1437 };
    +1438 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier, KJUR.asn1.x509.Extension);
    +1439 
    +1440 /**
    +1441  * SubjectKeyIdentifier ASN.1 structure class
    +1442  * @name KJUR.asn1.x509.SubjectKeyIdentifier
    +1443  * @class SubjectKeyIdentifier ASN.1 structure class
    +1444  * @param {Array} params associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
    +1445  * @extends KJUR.asn1.x509.Extension
    +1446  * @since asn1x509 1.1.7 jsrsasign 8.0.14
    +1447  * @description
    +1448  * This class represents ASN.1 structure for <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">SubjectKeyIdentifier in RFC 5280</a>.
    +1449  * Constructor of this class may have following parameters:
    +1450  * <ul>
    +1451  * <li>kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of authority public key or authcertificate 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>
    +1452  * <li>critical - boolean to specify criticality of this extension
    +1453  * however conforming CA must mark this extension as non-critical in RFC 5280.</li>
    +1454  * </ul>
    +1455  * <pre>
    +1456  * d-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 }
    +1457  * SubjectKeyIdentifier ::= KeyIdentifier
    +1458  * KeyIdentifier ::= OCTET STRING
    +1459  * </pre>
    +1460  *
    +1461  * @example
    +1462  * // set by hexadecimal string
    +1463  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: {hex: '89ab'}});
    +1464  * // set by PEM public key or certificate string
    +1465  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: "-----BEGIN CERTIFICATE..."});
    +1466  * // set by public key object
    +1467  * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1468  * e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: pubkey});
    +1469  */
    +1470 KJUR.asn1.x509.SubjectKeyIdentifier = function(params) {
    +1471     KJUR.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this, params);
    +1472     var _KJUR = KJUR,
    +1473 	_KJUR_asn1 = _KJUR.asn1,
    +1474 	_DEROctetString = _KJUR_asn1.DEROctetString;
    +1475 
    +1476     this.asn1KID = null;
    +1477 
    +1478     this.getExtnValueHex = function() {
    +1479         this.asn1ExtnValue = this.asn1KID;
    +1480         return this.asn1ExtnValue.getEncodedHex();
    +1481     };
    +1482 
    +1483     /**
    +1484      * set keyIdentifier value by DEROctetString parameter, key object or PEM file
    +1485      * @name setKIDByParam
    +1486      * @memberOf KJUR.asn1.x509.SubjectKeyIdentifier#
    +1487      * @function
    +1488      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
    +1489      * @since asn1x509 1.1.7 jsrsasign 8.0.14
    +1490      * @description
    +1491      * <ul>
    +1492      * <li>{str: "123"} - by raw string</li>
    +1493      * <li>{hex: "01af..."} - by hexadecimal value</li>
    +1494      * <li>RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object.
    +1495      * key identifier value will be calculated by the method described in
    +1496      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1497      * </li>
    +1498      * <li>certificate PEM string - extract subjectPublicKeyInfo from specified PEM
    +1499      * certificate and
    +1500      * key identifier value will be calculated by the method described in
    +1501      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1502      * <li>PKCS#1/#8 public key PEM string - pem will be converted to a key object and
    +1503      * to PKCS#8 ASN.1 structure then calculate 
    +1504      * a key identifier value will be calculated by the method described in
    +1505      * <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2">RFC 5280 4.2.1.2 (1)</a>.
    +1506      * </ul>
    +1507      *
    +1508      * NOTE1: Automatic key identifier calculation is supported
    +1509      * since jsrsasign 8.0.16.
    +1510      *
    +1511      * @see KEYUTIL.getKeyID
    +1512      *
    +1513      * @example
    +1514      * o = new KJUR.asn1.x509.SubjectKeyIdentifier();
    +1515      * // set by hexadecimal string
    +1516      * o.setKIDByParam({hex: '1ad9...'});
    +1517      * // set by SubjectPublicKeyInfo of PEM certificate string
    +1518      * o.setKIDByParam("-----BEGIN CERTIFICATE...");
    +1519      * // set by PKCS#8 PEM public key string
    +1520      * o.setKIDByParam("-----BEGIN PUBLIC KEY...");
    +1521      * // set by public key object
    +1522      * pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE...");
    +1523      * o.setKIDByParam(pubkey);
    +1524      */
    +1525     this.setKIDByParam = function(param) {
    +1526 	if (param.str !== undefined ||
    +1527 	    param.hex !== undefined) {
    +1528 	    this.asn1KID = new _DEROctetString(param);
    +1529 	} else if ((typeof param === "object" &&
    +1530 		    KJUR.crypto.Util.isKey(param)) ||
    +1531 		   (typeof param === "string" &&
    +1532 		    param.indexOf("BEGIN") != -1)) {
    +1533 
    +1534 	    var keyobj = param;
    +1535 	    if (typeof param === "string") {
    +1536 		keyobj = KEYUTIL.getKey(param);
    +1537 	    }
    +1538 
    +1539 	    var kid = KEYUTIL.getKeyID(keyobj);
    +1540 	    this.asn1KID = new KJUR.asn1.DEROctetString({hex: kid});
    +1541 	}
    +1542     };
    +1543 
    +1544     this.oid = "2.5.29.14";
    +1545     if (params !== undefined) {
    +1546 	if (params.kid !== undefined) {
    +1547 	    this.setKIDByParam(params.kid);
    +1548 	}
    +1549     }
    +1550 };
    +1551 YAHOO.lang.extend(KJUR.asn1.x509.SubjectKeyIdentifier, KJUR.asn1.x509.Extension);
    +1552 
    +1553 /**
    +1554  * AuthorityInfoAccess ASN.1 structure class
    +1555  * @name KJUR.asn1.x509.AuthorityInfoAccess
    +1556  * @class AuthorityInfoAccess ASN.1 structure class
    +1557  * @param {Array} params associative array of parameters
    +1558  * @extends KJUR.asn1.x509.Extension
    +1559  * @since asn1x509 1.0.8
    +1560  * @description
    +1561  * <pre>
    +1562  * id-pe OBJECT IDENTIFIER  ::=  { id-pkix 1 }
    +1563  * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
    +1564  * AuthorityInfoAccessSyntax  ::=
    +1565  *         SEQUENCE SIZE (1..MAX) OF AccessDescription
    +1566  * AccessDescription  ::=  SEQUENCE {
    +1567  *         accessMethod          OBJECT IDENTIFIER,
    +1568  *         accessLocation        GeneralName  }
    +1569  * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
    +1570  * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
    +1571  * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
    +1572  * </pre>
    +1573  * @example
    +1574  * e1 = new KJUR.asn1.x509.AuthorityInfoAccess({
    +1575  *   array: [{
    +1576  *     accessMethod:{'oid': '1.3.6.1.5.5.7.48.1'},
    +1577  *     accessLocation:{'uri': 'http://ocsp.cacert.org'}
    +1578  *   }]
    +1579  * });
    +1580  */
    +1581 KJUR.asn1.x509.AuthorityInfoAccess = function(params) {
    +1582     KJUR.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this, params);
    +1583 
    +1584     this.setAccessDescriptionArray = function(accessDescriptionArray) {
    +1585         var array = new Array(),
    +1586 	    _KJUR = KJUR,
    +1587 	    _KJUR_asn1 = _KJUR.asn1,
    +1588 	    _DERSequence = _KJUR_asn1.DERSequence;
    +1589 
    +1590         for (var i = 0; i < accessDescriptionArray.length; i++) {
    +1591             var o = new _KJUR_asn1.DERObjectIdentifier(accessDescriptionArray[i].accessMethod);
    +1592             var gn = new _KJUR_asn1.x509.GeneralName(accessDescriptionArray[i].accessLocation);
    +1593             var accessDescription = new _DERSequence({'array':[o, gn]});
    +1594             array.push(accessDescription);
    +1595         }
    +1596         this.asn1ExtnValue = new _DERSequence({'array':array});
    +1597     };
    +1598 
    +1599     this.getExtnValueHex = function() {
    +1600         return this.asn1ExtnValue.getEncodedHex();
    +1601     };
    +1602 
    +1603     this.oid = "1.3.6.1.5.5.7.1.1";
    +1604     if (params !== undefined) {
    +1605         if (params.array !== undefined) {
    +1606             this.setAccessDescriptionArray(params.array);
    +1607         }
    +1608     }
    +1609 };
    +1610 YAHOO.lang.extend(KJUR.asn1.x509.AuthorityInfoAccess, KJUR.asn1.x509.Extension);
    +1611 
    +1612 /**
    +1613  * SubjectAltName ASN.1 structure class<br/>
    +1614  * @name KJUR.asn1.x509.SubjectAltName
    +1615  * @class SubjectAltName ASN.1 structure class
    +1616  * @param {Array} params associative array of parameters
    +1617  * @extends KJUR.asn1.x509.Extension
    +1618  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    +1619  * @see KJUR.asn1.x509.GeneralNames
    +1620  * @see KJUR.asn1.x509.GeneralName
    +1621  * @description
    +1622  * This class provides X.509v3 SubjectAltName extension.
    +1623  * <pre>
    +1624  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 }
    +1625  * SubjectAltName ::= GeneralNames
    +1626  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +1627  * GeneralName ::= CHOICE {
    +1628  *   otherName                  [0] OtherName,
    +1629  *   rfc822Name                 [1] IA5String,
    +1630  *   dNSName                    [2] IA5String,
    +1631  *   x400Address                [3] ORAddress,
    +1632  *   directoryName              [4] Name,
    +1633  *   ediPartyName               [5] EDIPartyName,
    +1634  *   uniformResourceIdentifier  [6] IA5String,
    +1635  *   iPAddress                  [7] OCTET STRING,
    +1636  *   registeredID               [8] OBJECT IDENTIFIER }
    +1637  * </pre>
    +1638  * @example
    +1639  * e1 = new KJUR.asn1.x509.SubjectAltName({
    +1640  *   critical: true,
    +1641  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    +1642  * });
    +1643  */
    +1644 KJUR.asn1.x509.SubjectAltName = function(params) {
    +1645     KJUR.asn1.x509.SubjectAltName.superclass.constructor.call(this, params)
    +1646 
    +1647     this.setNameArray = function(paramsArray) {
    +1648 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    +1649     };
     1650 
    -1651 // === BEGIN X500Name Related =================================================
    -1652 /**
    -1653  * X500Name ASN.1 structure class
    -1654  * @name KJUR.asn1.x509.X500Name
    -1655  * @class X500Name ASN.1 structure class
    -1656  * @param {Array} params associative array of parameters (ex. {'str': '/C=US/O=a'})
    -1657  * @extends KJUR.asn1.ASN1Object
    -1658  * @see KJUR.asn1.x509.X500Name
    -1659  * @see KJUR.asn1.x509.RDN
    -1660  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -1661  * @description
    -1662  * This class provides DistinguishedName ASN.1 class structure
    -1663  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    -1664  * <blockquote><pre>
    -1665  * DistinguishedName ::= RDNSequence
    -1666  *
    -1667  * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    -1668  *
    -1669  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    -1670  *   AttributeTypeAndValue
    -1671  *
    -1672  * AttributeTypeAndValue ::= SEQUENCE {
    -1673  *   type  AttributeType,
    -1674  *   value AttributeValue }
    -1675  * </pre></blockquote>
    -1676  * <br/>
    -1677  * Argument for the constructor can be one of following parameters:
    -1678  * <ul>
    -1679  * <li>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>
    -1680  * <li>ldapstr - string for distinguish name in LDAP format (ex: CN=test,O=test,C=US)</li>
    -1681  * <li>hex - hexadecimal string for ASN.1 distinguish name structure</li>
    -1682  * <li>certissuer - issuer name in the specified PEM certificate</li>
    -1683  * <li>certsubject - subject name in the specified PEM certificate</li>
    -1684  * </ul>
    -1685  * <br/>
    -1686  * NOTE: Multi-valued RDN is supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    -1687  * @example
    -1688  * // 1. construct with string
    -1689  * o = new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa/OU=bbb/CN=foo@example.com"});
    -1690  * o = new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    -1691  * // 2. construct by LDAP string
    -1692  * o = new KJUR.asn1.x509.X500Name({ldapstr: "CN=foo@example.com,OU=bbb,C=US"});
    -1693  * // 3. construct by ASN.1 hex string
    -1694  * o = new KJUR.asn1.x509.X500Name({hex: "304c3120..."});
    -1695  * // 4. construct by issuer of PEM certificate
    -1696  * o = new KJUR.asn1.x509.X500Name({certsubject: "-----BEGIN CERT..."});
    -1697  * // 5. construct by subject of PEM certificate
    -1698  * o = new KJUR.asn1.x509.X500Name({certissuer: "-----BEGIN CERT..."});
    -1699  * // 6. construct by object
    -1700  * o = new KJUR.asn1.x509.X500Name({C: "US", O: "aaa", CN: "http://example.com/"});
    -1701  */
    -1702 KJUR.asn1.x509.X500Name = function(params) {
    -1703     KJUR.asn1.x509.X500Name.superclass.constructor.call(this);
    -1704     this.asn1Array = new Array();
    -1705     var _KJUR = KJUR,
    -1706 	_KJUR_asn1 = _KJUR.asn1,
    -1707 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -1708 	_pemtohex = pemtohex;
    -1709 
    -1710     /**
    -1711      * set DN by OpenSSL oneline distinguished name string<br/>
    -1712      * @name setByString
    -1713      * @memberOf KJUR.asn1.x509.X500Name#
    -1714      * @function
    -1715      * @param {String} dnStr distinguished name by string (ex. /C=US/O=aaa)
    -1716      * @description
    -1717      * Sets distinguished name by string. 
    -1718      * dnStr must be formatted as 
    -1719      * "/type0=value0/type1=value1/type2=value2...".
    -1720      * No need to escape a slash in an attribute value.
    -1721      * @example
    -1722      * name = new KJUR.asn1.x509.X500Name();
    -1723      * name.setByString("/C=US/O=aaa/OU=bbb/CN=foo@example.com");
    -1724      * // no need to escape slash in an attribute value
    -1725      * name.setByString("/C=US/O=aaa/CN=1980/12/31");
    -1726      */
    -1727     this.setByString = function(dnStr) {
    -1728         var a = dnStr.split('/');
    -1729         a.shift();
    -1730 
    -1731 	var a1 = [];
    -1732 	for (var i = 0; i < a.length; i++) {
    -1733 	  if (a[i].match(/^[^=]+=.+$/)) {
    -1734 	    a1.push(a[i]);
    -1735 	  } else {
    -1736 	    var lastidx = a1.length - 1;
    -1737 	    a1[lastidx] = a1[lastidx] + "/" + a[i];
    -1738 	  }
    -1739 	}
    -1740 
    -1741         for (var i = 0; i < a1.length; i++) {
    -1742             this.asn1Array.push(new _KJUR_asn1_x509.RDN({'str':a1[i]}));
    -1743         }
    -1744     };
    -1745 
    -1746     /**
    -1747      * set DN by LDAP(RFC 2253) distinguished name string<br/>
    -1748      * @name setByLdapString
    -1749      * @memberOf KJUR.asn1.x509.X500Name#
    -1750      * @function
    -1751      * @param {String} dnStr distinguished name by LDAP string (ex. O=aaa,C=US)
    -1752      * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -1753      * @see {@link KJUR.asn1.x509.X500Name.ldapToCompat}
    -1754      * @description
    -1755      * @example
    -1756      * name = new KJUR.asn1.x509.X500Name();
    -1757      * name.setByLdapString("CN=foo@example.com,OU=bbb,O=aaa,C=US");
    -1758      */
    -1759     this.setByLdapString = function(dnStr) {
    -1760 	var compat = _KJUR_asn1_x509.X500Name.ldapToCompat(dnStr);
    -1761 	this.setByString(compat);
    -1762     };
    -1763 
    -1764     /**
    -1765      * set DN by associative array<br/>
    -1766      * @name setByObject
    -1767      * @memberOf KJUR.asn1.x509.X500Name#
    -1768      * @function
    -1769      * @param {Array} dnObj associative array of DN (ex. {C: "US", O: "aaa"})
    -1770      * @since jsrsasign 4.9. asn1x509 1.0.13
    -1771      * @description
    -1772      * @example
    -1773      * name = new KJUR.asn1.x509.X500Name();
    -1774      * name.setByObject({C: "US", O: "aaa", CN="http://example.com/"1});
    -1775      */
    -1776     this.setByObject = function(dnObj) {
    -1777         // Get all the dnObject attributes and stuff them in the ASN.1 array.
    -1778         for (var x in dnObj) {
    -1779             if (dnObj.hasOwnProperty(x)) {
    -1780                 var newRDN = new KJUR.asn1.x509.RDN(
    -1781                     {'str': x + '=' + dnObj[x]});
    -1782                 // Initialize or push into the ANS1 array.
    -1783                 this.asn1Array ? this.asn1Array.push(newRDN)
    -1784                     : this.asn1Array = [newRDN];
    -1785             }
    -1786         }
    -1787     };
    -1788 
    -1789     this.getEncodedHex = function() {
    -1790         if (typeof this.hTLV == "string") return this.hTLV;
    -1791         var o = new _KJUR_asn1.DERSequence({"array": this.asn1Array});
    -1792         this.hTLV = o.getEncodedHex();
    -1793         return this.hTLV;
    -1794     };
    -1795 
    -1796     if (params !== undefined) {
    -1797         if (params.str !== undefined) {
    -1798             this.setByString(params.str);
    -1799         } else if (params.ldapstr !== undefined) {
    -1800 	    this.setByLdapString(params.ldapstr);
    -1801 	} else if (params.hex !== undefined) {
    -1802 	    this.hTLV = params.hex;
    -1803         } else if (params.certissuer !== undefined) {
    -1804             var x = new X509();
    -1805             x.readCertPEM(params.certissuer);
    -1806             this.hTLV = x.getIssuerHex();
    -1807         } else if (params.certsubject !== undefined) {
    -1808             var x = new X509();
    -1809             x.readCertPEM(params.certsubject);
    -1810             this.hTLV = x.getSubjectHex();
    -1811         // If params is an object, then set the ASN1 array just using the object
    -1812         // attributes. This is nice for fields that have lots of special
    -1813         // characters (i.e. CN: 'https://www.github.com/kjur//').
    -1814         } else if (typeof params === "object" &&
    -1815 		   params.certsubject === undefined &&
    -1816 		   params.certissuer === undefined) {
    -1817             this.setByObject(params);
    -1818         }
    -1819     }
    -1820 };
    -1821 YAHOO.lang.extend(KJUR.asn1.x509.X500Name, KJUR.asn1.ASN1Object);
    -1822 
    -1823 /**
    -1824  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format<br/>
    -1825  * @name compatToLDAP
    -1826  * @memberOf KJUR.asn1.x509.X500Name
    -1827  * @function
    -1828  * @param {String} s distinguished name string in OpenSSL oneline compat (ex. /C=US/O=test)
    -1829  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -1830  * @since jsrsasign 8.0.19 asn1x509 1.1.20
    -1831  * @description
    -1832  * This static method converts a distinguished name string in OpenSSL compat
    -1833  * format to LDAP(RFC 2253) format.
    -1834  * @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>
    -1835  * @see <a href="https://www.openssl.org/docs/man1.0.2/man1/openssl-x509.html#NAME-OPTIONS">OpenSSL x509 command manual - NAME OPTIONS</a>
    -1836  * @example
    -1837  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=test") → 'O=test,C=US'
    -1838  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=a,a") → 'O=a\,a,C=US'
    -1839  */
    -1840 KJUR.asn1.x509.X500Name.compatToLDAP = function(s) {
    -1841     if (s.substr(0, 1) !== "/") throw "malformed input";
    -1842 
    -1843     var result = "";
    -1844     s = s.substr(1);
    -1845 
    -1846     var a = s.split("/");
    -1847     a.reverse();
    -1848     a = a.map(function(s) {return s.replace(/,/, "\\,")});
    -1849 
    -1850     return a.join(",");
    -1851 };
    -1852 
    -1853 /**
    -1854  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format (DEPRECATED)<br/>
    -1855  * @name onelineToLDAP
    -1856  * @memberOf KJUR.asn1.x509.X500Name
    -1857  * @function
    -1858  * @param {String} s distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -1859  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -1860  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -1861  * @see KJUR.asn1.x509.X500Name.compatToLDAP
    -1862  * @description
    -1863  * This method is deprecated. Please use 
    -1864  * {@link KJUR.asn1.x509.X500Name.compatToLDAP} instead.
    -1865  */
    -1866 KJUR.asn1.x509.X500Name.onelineToLDAP = function(s) {
    -1867     return KJUR.asn1.x509.X500Name.compatToLDAP(s);
    -1868 }
    -1869 
    -1870 /**
    -1871  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format<br/>
    -1872  * @name ldapToCompat
    -1873  * @memberOf KJUR.asn1.x509.X500Name
    -1874  * @function
    -1875  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -1876  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -1877  * @since jsrsasign 8.0.19 asn1x509 1.1.10
    -1878  * @description
    -1879  * This static method converts a distinguished name string in 
    -1880  * LDAP(RFC 2253) format to OpenSSL compat format.
    -1881  * @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>
    -1882  * @example
    -1883  * KJUR.asn1.x509.X500Name.ldapToCompat('O=test,C=US') → '/C=US/O=test'
    -1884  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a\,a,C=US') → '/C=US/O=a,a'
    -1885  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a/a,C=US')  → '/C=US/O=a\/a'
    -1886  */
    -1887 KJUR.asn1.x509.X500Name.ldapToCompat = function(s) {
    -1888     var a = s.split(",");
    -1889 
    -1890     // join \,
    -1891     var isBSbefore = false;
    -1892     var a2 = [];
    -1893     for (var i = 0; a.length > 0; i++) {
    -1894 	var item = a.shift();
    -1895 	//console.log("item=" + item);
    -1896 
    -1897 	if (isBSbefore === true) {
    -1898 	    var a2last = a2.pop();
    -1899 	    var newitem = (a2last + "," + item).replace(/\\,/g, ",");
    -1900 	    a2.push(newitem);
    -1901 	    isBSbefore = false;
    -1902 	} else {
    -1903 	    a2.push(item);
    -1904 	}
    +1651     this.getExtnValueHex = function() {
    +1652         return this.asn1ExtnValue.getEncodedHex();
    +1653     };
    +1654 
    +1655     this.oid = "2.5.29.17";
    +1656     if (params !== undefined) {
    +1657         if (params.array !== undefined) {
    +1658             this.setNameArray(params.array);
    +1659         }
    +1660     }
    +1661 };
    +1662 YAHOO.lang.extend(KJUR.asn1.x509.SubjectAltName, KJUR.asn1.x509.Extension);
    +1663 
    +1664 /**
    +1665  * IssuerAltName ASN.1 structure class<br/>
    +1666  * @name KJUR.asn1.x509.IssuerAltName
    +1667  * @class IssuerAltName ASN.1 structure class
    +1668  * @param {Array} params associative array of parameters
    +1669  * @extends KJUR.asn1.x509.Extension
    +1670  * @since jsrsasign 6.2.3 asn1x509 1.0.19
    +1671  * @see KJUR.asn1.x509.GeneralNames
    +1672  * @see KJUR.asn1.x509.GeneralName
    +1673  * @description
    +1674  * This class provides X.509v3 IssuerAltName extension.
    +1675  * <pre>
    +1676  * id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 18 }
    +1677  * IssuerAltName ::= GeneralNames
    +1678  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +1679  * GeneralName ::= CHOICE {
    +1680  *   otherName                  [0] OtherName,
    +1681  *   rfc822Name                 [1] IA5String,
    +1682  *   dNSName                    [2] IA5String,
    +1683  *   x400Address                [3] ORAddress,
    +1684  *   directoryName              [4] Name,
    +1685  *   ediPartyName               [5] EDIPartyName,
    +1686  *   uniformResourceIdentifier  [6] IA5String,
    +1687  *   iPAddress                  [7] OCTET STRING,
    +1688  *   registeredID               [8] OBJECT IDENTIFIER }
    +1689  * </pre>
    +1690  * @example
    +1691  * e1 = new KJUR.asn1.x509.IssuerAltName({
    +1692  *   critical: true,
    +1693  *   array: [{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]
    +1694  * });
    +1695  */
    +1696 KJUR.asn1.x509.IssuerAltName = function(params) {
    +1697     KJUR.asn1.x509.IssuerAltName.superclass.constructor.call(this, params)
    +1698 
    +1699     this.setNameArray = function(paramsArray) {
    +1700 	this.asn1ExtnValue = new KJUR.asn1.x509.GeneralNames(paramsArray);
    +1701     };
    +1702 
    +1703     this.getExtnValueHex = function() {
    +1704         return this.asn1ExtnValue.getEncodedHex();
    +1705     };
    +1706 
    +1707     this.oid = "2.5.29.18";
    +1708     if (params !== undefined) {
    +1709         if (params.array !== undefined) {
    +1710             this.setNameArray(params.array);
    +1711         }
    +1712     }
    +1713 };
    +1714 YAHOO.lang.extend(KJUR.asn1.x509.IssuerAltName, KJUR.asn1.x509.Extension);
    +1715 
    +1716 // === END   X.509v3 Extensions Related =======================================
    +1717 
    +1718 // === BEGIN CRL Related ===================================================
    +1719 /**
    +1720  * X.509 CRL class to sign and generate hex encoded CRL
    +1721  * @name KJUR.asn1.x509.CRL
    +1722  * @class X.509 CRL class to sign and generate hex encoded certificate
    +1723  * @param {Array} params associative array of parameters (ex. {'tbsobj': obj, 'rsaprvkey': key})
    +1724  * @extends KJUR.asn1.ASN1Object
    +1725  * @since 1.0.3
    +1726  * @description
    +1727  * <br/>
    +1728  * As for argument 'params' for constructor, you can specify one of
    +1729  * following properties:
    +1730  * <ul>
    +1731  * <li>tbsobj - specify {@link KJUR.asn1.x509.TBSCertList} object to be signed</li>
    +1732  * <li>rsaprvkey - specify {@link RSAKey} object CA private key</li>
    +1733  * </ul>
    +1734  * NOTE: 'params' can be omitted.
    +1735  * <h4>EXAMPLE</h4>
    +1736  * @example
    +1737  * var prvKey = KEYUTIL.getKEY("-----BEGIN PRIVATE..."); // CA's private key
    +1738  * var crl = new KJUR.asn1x509.CRL({'tbsobj': tbs, 'prvkeyobj': prvKey});
    +1739  * crl.sign(); // issue CRL by CA's private key
    +1740  * var hCRL = crl.getEncodedHex();
    +1741  *
    +1742  * // CertificateList  ::=  SEQUENCE  {
    +1743  * //     tbsCertList          TBSCertList,
    +1744  * //     signatureAlgorithm   AlgorithmIdentifier,
    +1745  * //     signatureValue       BIT STRING  }
    +1746  */
    +1747 KJUR.asn1.x509.CRL = function(params) {
    +1748     KJUR.asn1.x509.CRL.superclass.constructor.call(this);
    +1749 
    +1750     var asn1TBSCertList = null,
    +1751 	asn1SignatureAlg = null,
    +1752 	asn1Sig = null,
    +1753 	hexSig = null,
    +1754 	prvKey = null;
    +1755 
    +1756     /**
    +1757      * sign TBSCertList and set signature value internally
    +1758      * @name sign
    +1759      * @memberOf KJUR.asn1.x509.CRL#
    +1760      * @function
    +1761      * @description
    +1762      * @example
    +1763      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'prvkeyobj': prvKey});
    +1764      * cert.sign();
    +1765      */
    +1766     this.sign = function() {
    +1767         this.asn1SignatureAlg = this.asn1TBSCertList.asn1SignatureAlg;
    +1768 
    +1769         sig = new KJUR.crypto.Signature({'alg': this.asn1SignatureAlg.nameAlg, 'prov': 'cryptojs/jsrsa'});
    +1770         sig.init(this.prvKey);
    +1771         sig.updateHex(this.asn1TBSCertList.getEncodedHex());
    +1772         this.hexSig = sig.sign();
    +1773 
    +1774         this.asn1Sig = new KJUR.asn1.DERBitString({'hex': '00' + this.hexSig});
    +1775 
    +1776         var seq = new KJUR.asn1.DERSequence({'array': [this.asn1TBSCertList,
    +1777                                                        this.asn1SignatureAlg,
    +1778                                                        this.asn1Sig]});
    +1779         this.hTLV = seq.getEncodedHex();
    +1780         this.isModified = false;
    +1781     };
    +1782 
    +1783     this.getEncodedHex = function() {
    +1784         if (this.isModified == false && this.hTLV != null) return this.hTLV;
    +1785         throw "not signed yet";
    +1786     };
    +1787 
    +1788     /**
    +1789      * get PEM formatted CRL string after signed
    +1790      * @name getPEMString
    +1791      * @memberOf KJUR.asn1.x509.CRL#
    +1792      * @function
    +1793      * @return PEM formatted string of certificate
    +1794      * @description
    +1795      * @example
    +1796      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'rsaprvkey': prvKey});
    +1797      * cert.sign();
    +1798      * var sPEM =  cert.getPEMString();
    +1799      */
    +1800     this.getPEMString = function() {
    +1801         var pemBody = hextob64nl(this.getEncodedHex());
    +1802         return "-----BEGIN X509 CRL-----\r\n" + 
    +1803 	    pemBody + 
    +1804 	    "\r\n-----END X509 CRL-----\r\n";
    +1805     };
    +1806 
    +1807     if (params !== undefined) {
    +1808         if (params.tbsobj !== undefined) {
    +1809             this.asn1TBSCertList = params.tbsobj;
    +1810         }
    +1811         if (params.prvkeyobj !== undefined) {
    +1812             this.prvKey = params.prvkeyobj;
    +1813         }
    +1814     }
    +1815 };
    +1816 YAHOO.lang.extend(KJUR.asn1.x509.CRL, KJUR.asn1.ASN1Object);
    +1817 
    +1818 /**
    +1819  * ASN.1 TBSCertList structure class for CRL
    +1820  * @name KJUR.asn1.x509.TBSCertList
    +1821  * @class ASN.1 TBSCertList structure class for CRL
    +1822  * @param {Array} params associative array of parameters (ex. {})
    +1823  * @extends KJUR.asn1.ASN1Object
    +1824  * @since 1.0.3
    +1825  * @description
    +1826  * <br/>
    +1827  * <h4>EXAMPLE</h4>
    +1828  * @example
    +1829  *  var o = new KJUR.asn1.x509.TBSCertList();
    +1830  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    +1831  *  o.setIssuerByParam({'str': '/C=US/O=a'});
    +1832  *  o.setNotThisUpdateByParam({'str': '130504235959Z'});
    +1833  *  o.setNotNextUpdateByParam({'str': '140504235959Z'});
    +1834  *  o.addRevokedCert({'int': 4}, {'str':'130514235959Z'}));
    +1835  *  o.addRevokedCert({'hex': '0f34dd'}, {'str':'130514235959Z'}));
    +1836  *
    +1837  * // TBSCertList  ::=  SEQUENCE  {
    +1838  * //        version                 Version OPTIONAL,
    +1839  * //                                     -- if present, MUST be v2
    +1840  * //        signature               AlgorithmIdentifier,
    +1841  * //        issuer                  Name,
    +1842  * //        thisUpdate              Time,
    +1843  * //        nextUpdate              Time OPTIONAL,
    +1844  * //        revokedCertificates     SEQUENCE OF SEQUENCE  {
    +1845  * //             userCertificate         CertificateSerialNumber,
    +1846  * //             revocationDate          Time,
    +1847  * //             crlEntryExtensions      Extensions OPTIONAL
    +1848  * //                                      -- if present, version MUST be v2
    +1849  * //                                  }  OPTIONAL,
    +1850  * //        crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
    +1851  */
    +1852 KJUR.asn1.x509.TBSCertList = function(params) {
    +1853     KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);
    +1854     var aRevokedCert = null,
    +1855 	_KJUR = KJUR,
    +1856 	_KJUR_asn1 = _KJUR.asn1,
    +1857 	_DERSequence = _KJUR_asn1.DERSequence,
    +1858 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +1859 	_Time = _KJUR_asn1_x509.Time;
    +1860 
    +1861     /**
    +1862      * set signature algorithm field by parameter
    +1863      * @name setSignatureAlgByParam
    +1864      * @memberOf KJUR.asn1.x509.TBSCertList#
    +1865      * @function
    +1866      * @param {Array} algIdParam AlgorithmIdentifier parameter
    +1867      * @description
    +1868      * @example
    +1869      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
    +1870      */
    +1871     this.setSignatureAlgByParam = function(algIdParam) {
    +1872         this.asn1SignatureAlg = 
    +1873 	    new _KJUR_asn1_x509.AlgorithmIdentifier(algIdParam);
    +1874     };
    +1875 
    +1876     /**
    +1877      * set issuer name field by parameter
    +1878      * @name setIssuerByParam
    +1879      * @memberOf KJUR.asn1.x509.TBSCertList#
    +1880      * @function
    +1881      * @param {Array} x500NameParam X500Name parameter
    +1882      * @description
    +1883      * @example
    +1884      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
    +1885      * @see KJUR.asn1.x509.X500Name
    +1886      */
    +1887     this.setIssuerByParam = function(x500NameParam) {
    +1888         this.asn1Issuer = new _KJUR_asn1_x509.X500Name(x500NameParam);
    +1889     };
    +1890 
    +1891     /**
    +1892      * set thisUpdate field by parameter
    +1893      * @name setThisUpdateByParam
    +1894      * @memberOf KJUR.asn1.x509.TBSCertList#
    +1895      * @function
    +1896      * @param {Array} timeParam Time parameter
    +1897      * @description
    +1898      * @example
    +1899      * tbsc.setThisUpdateByParam({'str': '130508235959Z'});
    +1900      * @see KJUR.asn1.x509.Time
    +1901      */
    +1902     this.setThisUpdateByParam = function(timeParam) {
    +1903         this.asn1ThisUpdate = new _Time(timeParam);
    +1904     };
     1905 
    -1906 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    -1907     }
    -1908 
    -1909     a2 = a2.map(function(s) {return s.replace("/", "\\/")});
    -1910     a2.reverse();
    -1911     return "/" + a2.join("/");
    -1912 };
    -1913 
    -1914 /**
    -1915  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format (DEPRECATED)<br/>
    -1916  * @name ldapToOneline
    -1917  * @memberOf KJUR.asn1.x509.X500Name
    -1918  * @function
    -1919  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    -1920  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    -1921  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -1922  * @description
    -1923  * This method is deprecated. Please use 
    -1924  * {@link KJUR.asn1.x509.X500Name.ldapToCompat} instead.
    -1925  */
    -1926 KJUR.asn1.x509.X500Name.ldapToOneline = function(s) {
    -1927     return KJUR.asn1.x509.X500Name.ldapToCompat(s);
    -1928 };
    -1929 
    -1930 /**
    -1931  * RDN (Relative Distinguished Name) ASN.1 structure class
    -1932  * @name KJUR.asn1.x509.RDN
    -1933  * @class RDN (Relative Distinguished Name) ASN.1 structure class
    -1934  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    -1935  * @extends KJUR.asn1.ASN1Object
    -1936  * @see KJUR.asn1.x509.X500Name
    -1937  * @see KJUR.asn1.x509.RDN
    -1938  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -1939  * @description
    -1940  * This class provides RelativeDistinguishedName ASN.1 class structure
    -1941  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    -1942  * <blockquote><pre>
    -1943  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    -1944  *   AttributeTypeAndValue
    -1945  *
    -1946  * AttributeTypeAndValue ::= SEQUENCE {
    -1947  *   type  AttributeType,
    -1948  *   value AttributeValue }
    -1949  * </pre></blockquote>
    -1950  * <br/>
    -1951  * NOTE: Multi-valued RDN is supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    -1952  * @example
    -1953  * rdn = new KJUR.asn1.x509.RDN({str: "CN=test"});
    -1954  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=bb+O=c"}); // multi-valued
    -1955  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=b\\+b+O=c"}); // plus escaped
    -1956  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=\"b+b\"+O=c"}); // double quoted
    -1957  */
    -1958 KJUR.asn1.x509.RDN = function(params) {
    -1959     KJUR.asn1.x509.RDN.superclass.constructor.call(this);
    -1960     this.asn1Array = new Array();
    -1961 
    -1962     /**
    -1963      * add one AttributeTypeAndValue by string<br/>
    -1964      * @name addByString
    -1965      * @memberOf KJUR.asn1.x509.RDN#
    -1966      * @function
    -1967      * @param {String} s string of AttributeTypeAndValue
    -1968      * @return {Object} unspecified
    -1969      * @description
    -1970      * This method add one AttributeTypeAndValue to RDN object.
    -1971      * @example
    -1972      * rdn = new KJUR.asn1.x509.RDN();
    -1973      * rdn.addByString("CN=john");
    -1974      * rdn.addByString("serialNumber=1234"); // for multi-valued RDN
    -1975      */
    -1976     this.addByString = function(s) {
    -1977         this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({'str': s}));
    -1978     };
    -1979 
    -1980     /**
    -1981      * add one AttributeTypeAndValue by multi-valued string<br/>
    -1982      * @name addByMultiValuedString
    -1983      * @memberOf KJUR.asn1.x509.RDN#
    -1984      * @function
    -1985      * @param {String} s string of multi-valued RDN
    -1986      * @return {Object} unspecified
    -1987      * @since jsrsasign 6.2.1 asn1x509 1.0.17
    -1988      * @description
    -1989      * This method add multi-valued RDN to RDN object.
    -1990      * @example
    -1991      * rdn = new KJUR.asn1.x509.RDN();
    -1992      * rdn.addByMultiValuedString("CN=john+O=test");
    -1993      * rdn.addByMultiValuedString("O=a+O=b\+b\+b+O=c"); // multi-valued RDN with quoted plus
    -1994      * rdn.addByMultiValuedString("O=a+O=\"b+b+b\"+O=c"); // multi-valued RDN with quoted quotation
    -1995      */
    -1996     this.addByMultiValuedString = function(s) {
    -1997 	var a = KJUR.asn1.x509.RDN.parseString(s);
    -1998 	for (var i = 0; i < a.length; i++) {
    -1999 	    this.addByString(a[i]);
    -2000 	}
    -2001     };
    -2002 
    -2003     this.getEncodedHex = function() {
    -2004         var o = new KJUR.asn1.DERSet({"array": this.asn1Array});
    -2005         this.TLV = o.getEncodedHex();
    -2006         return this.TLV;
    -2007     };
    -2008 
    -2009     if (params !== undefined) {
    -2010         if (params.str !== undefined) {
    -2011             this.addByMultiValuedString(params.str);
    -2012         }
    -2013     }
    -2014 };
    -2015 YAHOO.lang.extend(KJUR.asn1.x509.RDN, KJUR.asn1.ASN1Object);
    -2016 
    -2017 /**
    -2018  * parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'<br/>
    -2019  * @name parseString
    -2020  * @memberOf KJUR.asn1.x509.RDN
    -2021  * @function
    -2022  * @param {String} s multi-valued string of RDN
    -2023  * @return {Array} array of string of AttributeTypeAndValue
    -2024  * @since jsrsasign 6.2.1 asn1x509 1.0.17
    -2025  * @description
    -2026  * This static method parses multi-valued RDN string and split into
    -2027  * array of AttributeTypeAndValue.
    -2028  * @example
    -2029  * KJUR.asn1.x509.RDN.parseString("CN=john") → ["CN=john"]
    -2030  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test") → ["CN=john", "OU=test"]
    -2031  * KJUR.asn1.x509.RDN.parseString('CN="jo+hn"+OU=test') → ["CN=jo+hn", "OU=test"]
    -2032  * KJUR.asn1.x509.RDN.parseString('CN=jo\+hn+OU=test') → ["CN=jo+hn", "OU=test"]
    -2033  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test+OU=t1") → ["CN=john", "OU=test", "OU=t1"]
    -2034  */
    -2035 KJUR.asn1.x509.RDN.parseString = function(s) {
    -2036     var a = s.split(/\+/);
    -2037 
    -2038     // join \+
    -2039     var isBSbefore = false;
    -2040     var a2 = [];
    -2041     for (var i = 0; a.length > 0; i++) {
    -2042 	var item = a.shift();
    -2043 	//console.log("item=" + item);
    +1906     /**
    +1907      * set nextUpdate field by parameter
    +1908      * @name setNextUpdateByParam
    +1909      * @memberOf KJUR.asn1.x509.TBSCertList#
    +1910      * @function
    +1911      * @param {Array} timeParam Time parameter
    +1912      * @description
    +1913      * @example
    +1914      * tbsc.setNextUpdateByParam({'str': '130508235959Z'});
    +1915      * @see KJUR.asn1.x509.Time
    +1916      */
    +1917     this.setNextUpdateByParam = function(timeParam) {
    +1918         this.asn1NextUpdate = new _Time(timeParam);
    +1919     };
    +1920 
    +1921     /**
    +1922      * add revoked certificate by parameter
    +1923      * @name addRevokedCert
    +1924      * @memberOf KJUR.asn1.x509.TBSCertList#
    +1925      * @function
    +1926      * @param {Array} snParam DERInteger parameter for certificate serial number
    +1927      * @param {Array} timeParam Time parameter for revocation date
    +1928      * @description
    +1929      * @example
    +1930      * tbsc.addRevokedCert({'int': 3}, {'str': '130508235959Z'});
    +1931      * @see KJUR.asn1.x509.Time
    +1932      */
    +1933     this.addRevokedCert = function(snParam, timeParam) {
    +1934         var param = {};
    +1935         if (snParam != undefined && snParam != null)
    +1936 	    param['sn'] = snParam;
    +1937         if (timeParam != undefined && timeParam != null)
    +1938 	    param['time'] = timeParam;
    +1939         var o = new _KJUR_asn1_x509.CRLEntry(param);
    +1940         this.aRevokedCert.push(o);
    +1941     };
    +1942 
    +1943     this.getEncodedHex = function() {
    +1944         this.asn1Array = new Array();
    +1945 
    +1946         if (this.asn1Version != null) this.asn1Array.push(this.asn1Version);
    +1947         this.asn1Array.push(this.asn1SignatureAlg);
    +1948         this.asn1Array.push(this.asn1Issuer);
    +1949         this.asn1Array.push(this.asn1ThisUpdate);
    +1950         if (this.asn1NextUpdate != null) this.asn1Array.push(this.asn1NextUpdate);
    +1951 
    +1952         if (this.aRevokedCert.length > 0) {
    +1953             var seq = new _DERSequence({'array': this.aRevokedCert});
    +1954             this.asn1Array.push(seq);
    +1955         }
    +1956 
    +1957         var o = new _DERSequence({"array": this.asn1Array});
    +1958         this.hTLV = o.getEncodedHex();
    +1959         this.isModified = false;
    +1960         return this.hTLV;
    +1961     };
    +1962 
    +1963     this._initialize = function() {
    +1964         this.asn1Version = null;
    +1965         this.asn1SignatureAlg = null;
    +1966         this.asn1Issuer = null;
    +1967         this.asn1ThisUpdate = null;
    +1968         this.asn1NextUpdate = null;
    +1969         this.aRevokedCert = new Array();
    +1970     };
    +1971 
    +1972     this._initialize();
    +1973 };
    +1974 YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList, KJUR.asn1.ASN1Object);
    +1975 
    +1976 /**
    +1977  * ASN.1 CRLEntry structure class for CRL
    +1978  * @name KJUR.asn1.x509.CRLEntry
    +1979  * @class ASN.1 CRLEntry structure class for CRL
    +1980  * @param {Array} params associative array of parameters (ex. {})
    +1981  * @extends KJUR.asn1.ASN1Object
    +1982  * @since 1.0.3
    +1983  * @description
    +1984  * @example
    +1985  * var e = new KJUR.asn1.x509.CRLEntry({'time': {'str': '130514235959Z'}, 'sn': {'int': 234}});
    +1986  *
    +1987  * // revokedCertificates     SEQUENCE OF SEQUENCE  {
    +1988  * //     userCertificate         CertificateSerialNumber,
    +1989  * //     revocationDate          Time,
    +1990  * //     crlEntryExtensions      Extensions OPTIONAL
    +1991  * //                             -- if present, version MUST be v2 }
    +1992  */
    +1993 KJUR.asn1.x509.CRLEntry = function(params) {
    +1994     KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);
    +1995     var sn = null,
    +1996 	time = null,
    +1997 	_KJUR = KJUR,
    +1998 	_KJUR_asn1 = _KJUR.asn1;
    +1999 
    +2000     /**
    +2001      * set DERInteger parameter for serial number of revoked certificate
    +2002      * @name setCertSerial
    +2003      * @memberOf KJUR.asn1.x509.CRLEntry
    +2004      * @function
    +2005      * @param {Array} intParam DERInteger parameter for certificate serial number
    +2006      * @description
    +2007      * @example
    +2008      * entry.setCertSerial({'int': 3});
    +2009      */
    +2010     this.setCertSerial = function(intParam) {
    +2011         this.sn = new _KJUR_asn1.DERInteger(intParam);
    +2012     };
    +2013 
    +2014     /**
    +2015      * set Time parameter for revocation date
    +2016      * @name setRevocationDate
    +2017      * @memberOf KJUR.asn1.x509.CRLEntry
    +2018      * @function
    +2019      * @param {Array} timeParam Time parameter for revocation date
    +2020      * @description
    +2021      * @example
    +2022      * entry.setRevocationDate({'str': '130508235959Z'});
    +2023      */
    +2024     this.setRevocationDate = function(timeParam) {
    +2025         this.time = new _KJUR_asn1.x509.Time(timeParam);
    +2026     };
    +2027 
    +2028     this.getEncodedHex = function() {
    +2029         var o = new _KJUR_asn1.DERSequence({"array": [this.sn, this.time]});
    +2030         this.TLV = o.getEncodedHex();
    +2031         return this.TLV;
    +2032     };
    +2033 
    +2034     if (params !== undefined) {
    +2035         if (params.time !== undefined) {
    +2036             this.setRevocationDate(params.time);
    +2037         }
    +2038         if (params.sn !== undefined) {
    +2039             this.setCertSerial(params.sn);
    +2040         }
    +2041     }
    +2042 };
    +2043 YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry, KJUR.asn1.ASN1Object);
     2044 
    -2045 	if (isBSbefore === true) {
    -2046 	    var a2last = a2.pop();
    -2047 	    var newitem = (a2last + "+" + item).replace(/\\\+/g, "+");
    -2048 	    a2.push(newitem);
    -2049 	    isBSbefore = false;
    -2050 	} else {
    -2051 	    a2.push(item);
    -2052 	}
    -2053 
    -2054 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    -2055     }
    -2056 
    -2057     // join quote
    -2058     var beginQuote = false;
    -2059     var a3 = [];
    -2060     for (var i = 0; a2.length > 0; i++) {
    -2061 	var item = a2.shift();
    -2062 
    -2063 	if (beginQuote === true) {
    -2064 	    var a3last = a3.pop();
    -2065 	    if (item.match(/"$/)) {
    -2066 		var newitem = (a3last + "+" + item).replace(/^([^=]+)="(.*)"$/, "$1=$2");
    -2067 		a3.push(newitem);
    -2068 		beginQuote = false;
    -2069 	    } else {
    -2070 		a3.push(a3last + "+" + item);
    -2071 	    }
    -2072 	} else {
    -2073 	    a3.push(item);
    -2074 	}
    -2075 
    -2076 	if (item.match(/^[^=]+="/)) {
    -2077 	    //console.log(i + "=" + item);
    -2078 	    beginQuote = true;
    -2079 	}
    -2080     }
    -2081 
    -2082     return a3;
    -2083 };
    -2084 
    -2085 /**
    -2086  * AttributeTypeAndValue ASN.1 structure class
    -2087  * @name KJUR.asn1.x509.AttributeTypeAndValue
    -2088  * @class AttributeTypeAndValue ASN.1 structure class
    -2089  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    -2090  * @extends KJUR.asn1.ASN1Object
    -2091  * @description
    -2092  * @see KJUR.asn1.x509.X500Name
    -2093  * @see KJUR.asn1.x509.RDN
    -2094  * @see KJUR.asn1.x509.AttributeTypeAndValue
    -2095  * @example
    -2096  */
    -2097 KJUR.asn1.x509.AttributeTypeAndValue = function(params) {
    -2098     KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);
    -2099     var typeObj = null,
    -2100 	valueObj = null,
    -2101 	defaultDSType = "utf8",
    -2102 	_KJUR = KJUR,
    -2103 	_KJUR_asn1 = _KJUR.asn1;
    -2104 
    -2105     this.setByString = function(attrTypeAndValueStr) {
    -2106         var matchResult = attrTypeAndValueStr.match(/^([^=]+)=(.+)$/);
    -2107         if (matchResult) {
    -2108             this.setByAttrTypeAndValueStr(matchResult[1], matchResult[2]);
    -2109         } else {
    -2110             throw "malformed attrTypeAndValueStr: " + attrTypeAndValueStr;
    -2111         }
    -2112     };
    -2113 
    -2114     this.setByAttrTypeAndValueStr = function(shortAttrType, valueStr) {
    -2115         this.typeObj = KJUR.asn1.x509.OID.atype2obj(shortAttrType);
    -2116         var dsType = defaultDSType;
    -2117         if (shortAttrType == "C") dsType = "prn";
    -2118         this.valueObj = this.getValueObj(dsType, valueStr);
    -2119     };
    -2120 
    -2121     this.getValueObj = function(dsType, valueStr) {
    -2122         if (dsType == "utf8")   return new _KJUR_asn1.DERUTF8String({"str": valueStr});
    -2123         if (dsType == "prn")    return new _KJUR_asn1.DERPrintableString({"str": valueStr});
    -2124         if (dsType == "tel")    return new _KJUR_asn1.DERTeletexString({"str": valueStr});
    -2125         if (dsType == "ia5")    return new _KJUR_asn1.DERIA5String({"str": valueStr});
    -2126         throw "unsupported directory string type: type=" + dsType + " value=" + valueStr;
    -2127     };
    -2128 
    -2129     this.getEncodedHex = function() {
    -2130         var o = new _KJUR_asn1.DERSequence({"array": [this.typeObj, this.valueObj]});
    -2131         this.TLV = o.getEncodedHex();
    -2132         return this.TLV;
    -2133     };
    -2134 
    -2135     if (params !== undefined) {
    -2136         if (params.str !== undefined) {
    -2137             this.setByString(params.str);
    -2138         }
    -2139     }
    -2140 };
    -2141 YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue, KJUR.asn1.ASN1Object);
    -2142 
    -2143 // === END   X500Name Related =================================================
    -2144 
    -2145 // === BEGIN Other ASN1 structure class  ======================================
    -2146 
    -2147 /**
    -2148  * SubjectPublicKeyInfo ASN.1 structure class
    -2149  * @name KJUR.asn1.x509.SubjectPublicKeyInfo
    -2150  * @class SubjectPublicKeyInfo ASN.1 structure class
    -2151  * @param {Object} params parameter for subject public key
    -2152  * @extends KJUR.asn1.ASN1Object
    -2153  * @description
    -2154  * <br/>
    -2155  * As for argument 'params' for constructor, you can specify one of
    -2156  * following properties:
    -2157  * <ul>
    -2158  * <li>{@link RSAKey} object</li>
    -2159  * <li>{@link KJUR.crypto.ECDSA} object</li>
    -2160  * <li>{@link KJUR.crypto.DSA} object</li>
    -2161  * </ul>
    -2162  * NOTE1: 'params' can be omitted.<br/>
    -2163  * NOTE2: DSA/ECDSA key object is also supported since asn1x509 1.0.6.<br/>
    -2164  * <h4>EXAMPLE</h4>
    -2165  * @example
    -2166  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(RSAKey_object);
    -2167  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoECDSA_object);
    -2168  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoDSA_object);
    -2169  */
    -2170 KJUR.asn1.x509.SubjectPublicKeyInfo = function(params) {
    -2171     KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);
    -2172     var asn1AlgId = null,
    -2173 	asn1SubjPKey = null,
    -2174 	_KJUR = KJUR,
    -2175 	_KJUR_asn1 = _KJUR.asn1,
    -2176 	_DERInteger = _KJUR_asn1.DERInteger,
    -2177 	_DERBitString = _KJUR_asn1.DERBitString,
    -2178 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    -2179 	_DERSequence = _KJUR_asn1.DERSequence,
    -2180 	_newObject = _KJUR_asn1.ASN1Util.newObject,
    -2181 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    -2182 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    -2183 	_KJUR_crypto = _KJUR.crypto,
    -2184 	_KJUR_crypto_ECDSA = _KJUR_crypto.ECDSA,
    -2185 	_KJUR_crypto_DSA = _KJUR_crypto.DSA;
    -2186 
    -2187     /*
    -2188      * @since asn1x509 1.0.7
    -2189      */
    -2190     this.getASN1Object = function() {
    -2191         if (this.asn1AlgId == null || this.asn1SubjPKey == null)
    -2192             throw "algId and/or subjPubKey not set";
    -2193         var o = new _DERSequence({'array':
    -2194                                   [this.asn1AlgId, this.asn1SubjPKey]});
    -2195         return o;
    -2196     };
    -2197 
    -2198     this.getEncodedHex = function() {
    -2199         var o = this.getASN1Object();
    -2200         this.hTLV = o.getEncodedHex();
    -2201         return this.hTLV;
    -2202     };
    -2203 
    -2204     /**
    -2205      * @name setPubKey
    -2206      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo#
    -2207      * @function
    -2208      * @param {Object} {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object
    -2209      * @since jsrsasign 8.0.0 asn1x509 1.1.0
    -2210      * @description
    -2211      * @example
    -2212      * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo();
    -2213      * pubKey = KEYUTIL.getKey(PKCS8PUBKEYPEM);
    -2214      * spki.setPubKey(pubKey);
    -2215      */
    -2216     this.setPubKey = function(key) {
    -2217 	try {
    -2218 	    if (key instanceof RSAKey) {
    -2219 		var asn1RsaPub = _newObject({
    -2220 		    'seq': [{'int': {'bigint': key.n}}, {'int': {'int': key.e}}]
    -2221 		});
    -2222 		var rsaKeyHex = asn1RsaPub.getEncodedHex();
    -2223 		this.asn1AlgId = new _AlgorithmIdentifier({'name':'rsaEncryption'});
    -2224 		this.asn1SubjPKey = new _DERBitString({'hex':'00'+rsaKeyHex});
    -2225 	    }
    -2226 	} catch(ex) {};
    -2227 
    -2228 	try {
    -2229 	    if (key instanceof KJUR.crypto.ECDSA) {
    -2230 		var asn1Params = new _DERObjectIdentifier({'name': key.curveName});
    -2231 		this.asn1AlgId =
    -2232 		    new _AlgorithmIdentifier({'name': 'ecPublicKey',
    -2233 					      'asn1params': asn1Params});
    -2234 		this.asn1SubjPKey = new _DERBitString({'hex': '00' + key.pubKeyHex});
    -2235 	    }
    -2236 	} catch(ex) {};
    -2237 
    -2238 	try {
    -2239 	    if (key instanceof KJUR.crypto.DSA) {
    -2240 		var asn1Params = new _newObject({
    -2241 		    'seq': [{'int': {'bigint': key.p}},
    -2242 			    {'int': {'bigint': key.q}},
    -2243 			    {'int': {'bigint': key.g}}]
    -2244 		});
    -2245 		this.asn1AlgId =
    -2246 		    new _AlgorithmIdentifier({'name': 'dsa',
    -2247 					      'asn1params': asn1Params});
    -2248 		var pubInt = new _DERInteger({'bigint': key.y});
    -2249 		this.asn1SubjPKey = 
    -2250 		    new _DERBitString({'hex': '00' + pubInt.getEncodedHex()});
    -2251 	    }
    -2252 	} catch(ex) {};
    -2253     };
    -2254 
    -2255     if (params !== undefined) {
    -2256 	this.setPubKey(params);
    -2257     }
    -2258 };
    -2259 YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo, KJUR.asn1.ASN1Object);
    -2260 
    -2261 /**
    -2262  * Time ASN.1 structure class
    -2263  * @name KJUR.asn1.x509.Time
    -2264  * @class Time ASN.1 structure class
    -2265  * @param {Array} params associative array of parameters (ex. {'str': '130508235959Z'})
    -2266  * @extends KJUR.asn1.ASN1Object
    -2267  * @description
    -2268  * <br/>
    -2269  * <h4>EXAMPLES</h4>
    -2270  * @example
    -2271  * var t1 = new KJUR.asn1.x509.Time{'str': '130508235959Z'} // UTCTime by default
    -2272  * var t2 = new KJUR.asn1.x509.Time{'type': 'gen',  'str': '20130508235959Z'} // GeneralizedTime
    -2273  */
    -2274 KJUR.asn1.x509.Time = function(params) {
    -2275     KJUR.asn1.x509.Time.superclass.constructor.call(this);
    -2276     var type = null,
    -2277 	timeParams = null,
    -2278 	_KJUR = KJUR,
    -2279 	_KJUR_asn1 = _KJUR.asn1,
    -2280 	_DERUTCTime = _KJUR_asn1.DERUTCTime,
    -2281 	_DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime;
    -2282 
    -2283     this.setTimeParams = function(timeParams) {
    -2284         this.timeParams = timeParams;
    -2285     }
    -2286 
    -2287     this.getEncodedHex = function() {
    -2288         var o = null;
    -2289 
    -2290         if (this.timeParams != null) {
    -2291             if (this.type == "utc") {
    -2292                 o = new _DERUTCTime(this.timeParams);
    -2293             } else {
    -2294                 o = new _DERGeneralizedTime(this.timeParams);
    -2295             }
    -2296         } else {
    -2297             if (this.type == "utc") {
    -2298                 o = new _DERUTCTime();
    -2299             } else {
    -2300                 o = new _DERGeneralizedTime();
    -2301             }
    -2302         }
    -2303         this.TLV = o.getEncodedHex();
    -2304         return this.TLV;
    -2305     };
    -2306 
    -2307     this.type = "utc";
    -2308     if (params !== undefined) {
    -2309         if (params.type !== undefined) {
    -2310             this.type = params.type;
    -2311         } else {
    -2312             if (params.str !== undefined) {
    -2313                 if (params.str.match(/^[0-9]{12}Z$/)) this.type = "utc";
    -2314                 if (params.str.match(/^[0-9]{14}Z$/)) this.type = "gen";
    -2315             }
    -2316         }
    -2317         this.timeParams = params;
    -2318     }
    -2319 };
    -2320 YAHOO.lang.extend(KJUR.asn1.x509.Time, KJUR.asn1.ASN1Object);
    -2321 
    -2322 /**
    -2323  * AlgorithmIdentifier ASN.1 structure class
    -2324  * @name KJUR.asn1.x509.AlgorithmIdentifier
    -2325  * @class AlgorithmIdentifier ASN.1 structure class
    -2326  * @param {Array} params associative array of parameters (ex. {'name': 'SHA1withRSA'})
    -2327  * @extends KJUR.asn1.ASN1Object
    -2328  * @description
    -2329  * The 'params' argument is an associative array and has following parameters:
    -2330  * <ul>
    -2331  * <li>name: algorithm name (MANDATORY, ex. sha1, SHA256withRSA)</li>
    -2332  * <li>asn1params: explicitly specify ASN.1 object for algorithm.
    -2333  * (OPTION)</li>
    -2334  * <li>paramempty: set algorithm parameter to NULL by force.
    -2335  * If paramempty is false, algorithm parameter will be set automatically.
    -2336  * If paramempty is false and algorithm name is "*withDSA" or "withECDSA" parameter field of
    -2337  * AlgorithmIdentifier will be ommitted otherwise
    -2338  * it will be NULL by default.
    -2339  * (OPTION, DEFAULT = false)</li>
    -2340  * </ul>
    -2341  * RSA-PSS algorithm names such as SHA{,256,384,512}withRSAandMGF1 are
    -2342  * special names. They will set a suite of algorithm OID and multiple algorithm
    -2343  * parameters. Its ASN.1 schema is defined in 
    -2344  * <a href="https://tools.ietf.org/html/rfc3447#appendix-A.2.3">RFC 3447 PKCS#1 2.1
    -2345  * section A.2.3</a>.
    -2346  * <blockquote><pre>
    -2347  * id-RSASSA-PSS  OBJECT IDENTIFIER ::= { pkcs-1 10 }
    -2348  * RSASSA-PSS-params ::= SEQUENCE {
    -2349  *   hashAlgorithm      [0] HashAlgorithm    DEFAULT sha1,
    -2350  *   maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
    -2351  *   saltLength         [2] INTEGER          DEFAULT 20,
    -2352  *   trailerField       [3] TrailerField     DEFAULT trailerFieldBC }
    -2353  * mgf1SHA1    MaskGenAlgorithm ::= {
    -2354  *   algorithm   id-mgf1,
    -2355  *   parameters  HashAlgorithm : sha1 }
    -2356  * id-mgf1     OBJECT IDENTIFIER ::= { pkcs-1 8 }
    -2357  * TrailerField ::= INTEGER { trailerFieldBC(1) }
    -2358  * </pre></blockquote>
    -2359  * Here is a table for PSS parameters:
    -2360  * <table>
    -2361  * <tr><th>Name</th><th>alg oid</th><th>pss hash</th><th>maskgen</th></th><th>pss saltlen</th><th>trailer</th></tr>
    -2362  * <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>
    -2363  * <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>
    -2364  * <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>
    -2365  * <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>
    -2366  * </table>
    -2367  * Default value is omitted as defined in ASN.1 schema.
    -2368  * These parameters are interoperable to OpenSSL or IAIK toolkit.
    -2369  * <br/>
    -2370  * NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21. 
    -2371  * @example
    -2372  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"})
    -2373  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA"})
    -2374  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA512withRSAandMGF1"}) // set parameters automatically
    -2375  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA", paramempty: true})
    -2376  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "rsaEncryption"})
    -2377  */
    -2378 KJUR.asn1.x509.AlgorithmIdentifier = function(params) {
    -2379     KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);
    -2380     this.nameAlg = null;
    -2381     this.asn1Alg = null;
    -2382     this.asn1Params = null;
    -2383     this.paramEmpty = false;
    -2384 
    -2385     var _KJUR = KJUR,
    -2386 	_KJUR_asn1 = _KJUR.asn1,
    -2387 	_PSSNAME2ASN1TLV = _KJUR_asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;
    -2388 
    -2389     this.getEncodedHex = function() {
    -2390         if (this.nameAlg === null && this.asn1Alg === null) {
    -2391             throw new Error("algorithm not specified");
    -2392         }
    -2393 
    -2394 	// for RSAPSS algorithm name
    -2395 	//  && this.hTLV === null
    -2396 	if (this.nameAlg !== null) {
    -2397 	    var hTLV = null;
    -2398 	    for (var key in _PSSNAME2ASN1TLV) {
    -2399 		if (key === this.nameAlg) {
    -2400 		    hTLV = _PSSNAME2ASN1TLV[key];
    -2401 		}
    -2402 	    }
    -2403 	    if (hTLV !== null) {
    -2404 		this.hTLV = hTLV;
    -2405 		return this.hTLV;
    -2406 	    }
    -2407 	}
    -2408 
    -2409         if (this.nameAlg !== null && this.asn1Alg === null) {
    -2410             this.asn1Alg = _KJUR_asn1.x509.OID.name2obj(this.nameAlg);
    -2411         }
    -2412         var a = [this.asn1Alg];
    -2413         if (this.asn1Params !== null) a.push(this.asn1Params);
    -2414 
    -2415         var o = new _KJUR_asn1.DERSequence({'array': a});
    -2416         this.hTLV = o.getEncodedHex();
    -2417         return this.hTLV;
    -2418     };
    -2419 
    -2420     if (params !== undefined) {
    -2421         if (params.name !== undefined) {
    -2422             this.nameAlg = params.name;
    -2423         }
    -2424         if (params.asn1params !== undefined) {
    -2425             this.asn1Params = params.asn1params;
    -2426         }
    -2427         if (params.paramempty !== undefined) {
    -2428             this.paramEmpty = params.paramempty;
    -2429         }
    -2430     }
    -2431 
    -2432     // set algorithm parameters will be ommitted for
    -2433     // "*withDSA" or "*withECDSA" otherwise will be NULL.
    -2434     if (this.asn1Params === null &&
    -2435 	this.paramEmpty === false &&
    -2436 	this.nameAlg !== null) {
    -2437 	var lcNameAlg = this.nameAlg.toLowerCase();
    -2438 	if (lcNameAlg.substr(-7, 7) !== "withdsa" &&
    -2439 	    lcNameAlg.substr(-9, 9) !== "withecdsa") {
    -2440             this.asn1Params = new _KJUR_asn1.DERNull();
    -2441 	}
    -2442     }
    -2443 };
    -2444 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
    -2445 
    -2446 /**
    -2447  * AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names
    -2448  * @const
    -2449  */
    -2450 KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV = {
    -2451     "SHAwithRSAandMGF1":
    -2452     "300d06092a864886f70d01010a3000",
    -2453     "SHA256withRSAandMGF1":
    -2454     "303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",
    -2455     "SHA384withRSAandMGF1":
    -2456     "303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",
    -2457     "SHA512withRSAandMGF1":
    -2458     "303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"
    -2459 };
    -2460 
    -2461 /**
    -2462  * GeneralName ASN.1 structure class<br/>
    -2463  * @name KJUR.asn1.x509.GeneralName
    -2464  * @class GeneralName ASN.1 structure class
    -2465  * @description
    -2466  * <br/>
    -2467  * As for argument 'params' for constructor, you can specify one of
    -2468  * following properties:
    -2469  * <ul>
    -2470  * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li>
    -2471  * <li>dns - dNSName[2] (ex. foo.com)</li>
    -2472  * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
    -2473  * <li>dn - directoryName[4] 
    -2474  * distinguished name string or X500Name class parameters can be
    -2475  * specified (ex. "/C=US/O=Test", {hex: '301c...')</li>
    -2476  * <li>ldapdn - directoryName[4] (ex. O=Test,C=US)</li>
    -2477  * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
    -2478  * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
    -2479  * <li>ip - iPAddress[7] (ex. 192.168.1.1, 2001:db3::43, 3faa0101...)</li>
    -2480  * </ul>
    -2481  * NOTE1: certissuer and certsubj were supported since asn1x509 1.0.10.<br/>
    -2482  * NOTE2: dn and ldapdn were supported since jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    -2483  * NOTE3: ip were supported since jsrsasign 8.0.10 asn1x509 1.1.4.<br/>
    -2484  * NOTE4: X500Name parameters in dn were supported since jsrsasign 8.0.16.<br/>
    -2485  *
    -2486  * Here is definition of the ASN.1 syntax:
    -2487  * <pre>
    -2488  * -- NOTE: under the CHOICE, it will always be explicit.
    -2489  * GeneralName ::= CHOICE {
    -2490  *   otherName                  [0] OtherName,
    -2491  *   rfc822Name                 [1] IA5String,
    -2492  *   dNSName                    [2] IA5String,
    -2493  *   x400Address                [3] ORAddress,
    -2494  *   directoryName              [4] Name,
    -2495  *   ediPartyName               [5] EDIPartyName,
    -2496  *   uniformResourceIdentifier  [6] IA5String,
    -2497  *   iPAddress                  [7] OCTET STRING,
    -2498  *   registeredID               [8] OBJECT IDENTIFIER }
    -2499  * </pre>
    -2500  *
    -2501  * @example
    -2502  * gn = new KJUR.asn1.x509.GeneralName({dn:     '/C=US/O=Test'});
    -2503  * gn = new KJUR.asn1.x509.GeneralName({dn:     X500NameObject);
    -2504  * gn = new KJUR.asn1.x509.GeneralName({dn:     {str: /C=US/O=Test'});
    -2505  * gn = new KJUR.asn1.x509.GeneralName({dn:     {ldapstr: 'O=Test,C=US'});
    -2506  * gn = new KJUR.asn1.x509.GeneralName({dn:     {hex: '301c...'});
    -2507  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certissuer: PEMCERTSTRING});
    -2508  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certsubject: PEMCERTSTRING});
    -2509  * gn = new KJUR.asn1.x509.GeneralName({ip:     '192.168.1.1'});
    -2510  * gn = new KJUR.asn1.x509.GeneralName({ip:     '2001:db4::4:1'});
    -2511  * gn = new KJUR.asn1.x509.GeneralName({ip:     'c0a80101'});
    -2512  * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'});
    -2513  * gn = new KJUR.asn1.x509.GeneralName({dns:    'aaa.com'});
    -2514  * gn = new KJUR.asn1.x509.GeneralName({uri:    'http://aaa.com/'});
    -2515  *
    -2516  * gn = new KJUR.asn1.x509.GeneralName({ldapdn:     'O=Test,C=US'}); // DEPRECATED
    -2517  * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});       // DEPRECATED
    -2518  * gn = new KJUR.asn1.x509.GeneralName({certsubj:   certPEM});       // DEPRECATED
    -2519  */
    -2520 KJUR.asn1.x509.GeneralName = function(params) {
    -2521     KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);
    -2522     var asn1Obj = null,
    -2523 	type = null,
    -2524 	pTag = {rfc822: '81', dns: '82', dn: 'a4',  uri: '86', ip: '87'},
    -2525 	_KJUR = KJUR,
    -2526 	_KJUR_asn1 = _KJUR.asn1,
    -2527 	_DERSequence = _KJUR_asn1.DERSequence,
    -2528 	_DEROctetString = _KJUR_asn1.DEROctetString,
    -2529 	_DERIA5String = _KJUR_asn1.DERIA5String,
    -2530 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    -2531 	_ASN1Object = _KJUR_asn1.ASN1Object,
    -2532 	_X500Name = _KJUR_asn1.x509.X500Name,
    -2533 	_pemtohex = pemtohex;
    -2534 	
    -2535     this.explicit = false;
    -2536 
    -2537     this.setByParam = function(params) {
    -2538         var str = null;
    -2539         var v = null;
    +2045 // === END   CRL Related ===================================================
    +2046 
    +2047 // === BEGIN X500Name Related =================================================
    +2048 /**
    +2049  * X500Name ASN.1 structure class
    +2050  * @name KJUR.asn1.x509.X500Name
    +2051  * @class X500Name ASN.1 structure class
    +2052  * @param {Array} params associative array of parameters (ex. {'str': '/C=US/O=a'})
    +2053  * @extends KJUR.asn1.ASN1Object
    +2054  * @see KJUR.asn1.x509.X500Name
    +2055  * @see KJUR.asn1.x509.RDN
    +2056  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +2057  * @description
    +2058  * This class provides DistinguishedName ASN.1 class structure
    +2059  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    +2060  * <blockquote><pre>
    +2061  * DistinguishedName ::= RDNSequence
    +2062  *
    +2063  * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
    +2064  *
    +2065  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    +2066  *   AttributeTypeAndValue
    +2067  *
    +2068  * AttributeTypeAndValue ::= SEQUENCE {
    +2069  *   type  AttributeType,
    +2070  *   value AttributeValue }
    +2071  * </pre></blockquote>
    +2072  * <br/>
    +2073  * Argument for the constructor can be one of following parameters:
    +2074  * <ul>
    +2075  * <li>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>
    +2076  * <li>ldapstr - string for distinguish name in LDAP format (ex: CN=test,O=test,C=US)</li>
    +2077  * <li>hex - hexadecimal string for ASN.1 distinguish name structure</li>
    +2078  * <li>certissuer - issuer name in the specified PEM certificate</li>
    +2079  * <li>certsubject - subject name in the specified PEM certificate</li>
    +2080  * </ul>
    +2081  * <br/>
    +2082  * NOTE: Multi-valued RDN is supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    +2083  * @example
    +2084  * // 1. construct with string
    +2085  * o = new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa/OU=bbb/CN=foo@example.com"});
    +2086  * o = new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa+CN=contact@example.com"}); // multi valued
    +2087  * // 2. construct by LDAP string
    +2088  * o = new KJUR.asn1.x509.X500Name({ldapstr: "CN=foo@example.com,OU=bbb,C=US"});
    +2089  * // 3. construct by ASN.1 hex string
    +2090  * o = new KJUR.asn1.x509.X500Name({hex: "304c3120..."});
    +2091  * // 4. construct by issuer of PEM certificate
    +2092  * o = new KJUR.asn1.x509.X500Name({certsubject: "-----BEGIN CERT..."});
    +2093  * // 5. construct by subject of PEM certificate
    +2094  * o = new KJUR.asn1.x509.X500Name({certissuer: "-----BEGIN CERT..."});
    +2095  * // 6. construct by object
    +2096  * o = new KJUR.asn1.x509.X500Name({C: "US", O: "aaa", CN: "http://example.com/"});
    +2097  */
    +2098 KJUR.asn1.x509.X500Name = function(params) {
    +2099     KJUR.asn1.x509.X500Name.superclass.constructor.call(this);
    +2100     this.asn1Array = new Array();
    +2101     var _KJUR = KJUR,
    +2102 	_KJUR_asn1 = _KJUR.asn1,
    +2103 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +2104 	_pemtohex = pemtohex;
    +2105 
    +2106     /**
    +2107      * set DN by OpenSSL oneline distinguished name string<br/>
    +2108      * @name setByString
    +2109      * @memberOf KJUR.asn1.x509.X500Name#
    +2110      * @function
    +2111      * @param {String} dnStr distinguished name by string (ex. /C=US/O=aaa)
    +2112      * @description
    +2113      * Sets distinguished name by string. 
    +2114      * dnStr must be formatted as 
    +2115      * "/type0=value0/type1=value1/type2=value2...".
    +2116      * No need to escape a slash in an attribute value.
    +2117      * @example
    +2118      * name = new KJUR.asn1.x509.X500Name();
    +2119      * name.setByString("/C=US/O=aaa/OU=bbb/CN=foo@example.com");
    +2120      * // no need to escape slash in an attribute value
    +2121      * name.setByString("/C=US/O=aaa/CN=1980/12/31");
    +2122      */
    +2123     this.setByString = function(dnStr) {
    +2124         var a = dnStr.split('/');
    +2125         a.shift();
    +2126 
    +2127 	var a1 = [];
    +2128 	for (var i = 0; i < a.length; i++) {
    +2129 	  if (a[i].match(/^[^=]+=.+$/)) {
    +2130 	    a1.push(a[i]);
    +2131 	  } else {
    +2132 	    var lastidx = a1.length - 1;
    +2133 	    a1[lastidx] = a1[lastidx] + "/" + a[i];
    +2134 	  }
    +2135 	}
    +2136 
    +2137         for (var i = 0; i < a1.length; i++) {
    +2138             this.asn1Array.push(new _KJUR_asn1_x509.RDN({'str':a1[i]}));
    +2139         }
    +2140     };
    +2141 
    +2142     /**
    +2143      * set DN by LDAP(RFC 2253) distinguished name string<br/>
    +2144      * @name setByLdapString
    +2145      * @memberOf KJUR.asn1.x509.X500Name#
    +2146      * @function
    +2147      * @param {String} dnStr distinguished name by LDAP string (ex. O=aaa,C=US)
    +2148      * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2149      * @see {@link KJUR.asn1.x509.X500Name.ldapToCompat}
    +2150      * @description
    +2151      * @example
    +2152      * name = new KJUR.asn1.x509.X500Name();
    +2153      * name.setByLdapString("CN=foo@example.com,OU=bbb,O=aaa,C=US");
    +2154      */
    +2155     this.setByLdapString = function(dnStr) {
    +2156 	var compat = _KJUR_asn1_x509.X500Name.ldapToCompat(dnStr);
    +2157 	this.setByString(compat);
    +2158     };
    +2159 
    +2160     /**
    +2161      * set DN by associative array<br/>
    +2162      * @name setByObject
    +2163      * @memberOf KJUR.asn1.x509.X500Name#
    +2164      * @function
    +2165      * @param {Array} dnObj associative array of DN (ex. {C: "US", O: "aaa"})
    +2166      * @since jsrsasign 4.9. asn1x509 1.0.13
    +2167      * @description
    +2168      * @example
    +2169      * name = new KJUR.asn1.x509.X500Name();
    +2170      * name.setByObject({C: "US", O: "aaa", CN="http://example.com/"1});
    +2171      */
    +2172     this.setByObject = function(dnObj) {
    +2173         // Get all the dnObject attributes and stuff them in the ASN.1 array.
    +2174         for (var x in dnObj) {
    +2175             if (dnObj.hasOwnProperty(x)) {
    +2176                 var newRDN = new KJUR.asn1.x509.RDN(
    +2177                     {'str': x + '=' + dnObj[x]});
    +2178                 // Initialize or push into the ANS1 array.
    +2179                 this.asn1Array ? this.asn1Array.push(newRDN)
    +2180                     : this.asn1Array = [newRDN];
    +2181             }
    +2182         }
    +2183     };
    +2184 
    +2185     this.getEncodedHex = function() {
    +2186         if (typeof this.hTLV == "string") return this.hTLV;
    +2187         var o = new _KJUR_asn1.DERSequence({"array": this.asn1Array});
    +2188         this.hTLV = o.getEncodedHex();
    +2189         return this.hTLV;
    +2190     };
    +2191 
    +2192     if (params !== undefined) {
    +2193         if (params.str !== undefined) {
    +2194             this.setByString(params.str);
    +2195         } else if (params.ldapstr !== undefined) {
    +2196 	    this.setByLdapString(params.ldapstr);
    +2197 	} else if (params.hex !== undefined) {
    +2198 	    this.hTLV = params.hex;
    +2199         } else if (params.certissuer !== undefined) {
    +2200             var x = new X509();
    +2201             x.readCertPEM(params.certissuer);
    +2202             this.hTLV = x.getIssuerHex();
    +2203         } else if (params.certsubject !== undefined) {
    +2204             var x = new X509();
    +2205             x.readCertPEM(params.certsubject);
    +2206             this.hTLV = x.getSubjectHex();
    +2207         // If params is an object, then set the ASN1 array just using the object
    +2208         // attributes. This is nice for fields that have lots of special
    +2209         // characters (i.e. CN: 'https://www.github.com/kjur//').
    +2210         } else if (typeof params === "object" &&
    +2211 		   params.certsubject === undefined &&
    +2212 		   params.certissuer === undefined) {
    +2213             this.setByObject(params);
    +2214         }
    +2215     }
    +2216 };
    +2217 YAHOO.lang.extend(KJUR.asn1.x509.X500Name, KJUR.asn1.ASN1Object);
    +2218 
    +2219 /**
    +2220  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format<br/>
    +2221  * @name compatToLDAP
    +2222  * @memberOf KJUR.asn1.x509.X500Name
    +2223  * @function
    +2224  * @param {String} s distinguished name string in OpenSSL oneline compat (ex. /C=US/O=test)
    +2225  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2226  * @since jsrsasign 8.0.19 asn1x509 1.1.20
    +2227  * @description
    +2228  * This static method converts a distinguished name string in OpenSSL compat
    +2229  * format to LDAP(RFC 2253) format.
    +2230  * @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>
    +2231  * @see <a href="https://www.openssl.org/docs/man1.0.2/man1/openssl-x509.html#NAME-OPTIONS">OpenSSL x509 command manual - NAME OPTIONS</a>
    +2232  * @example
    +2233  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=test") → 'O=test,C=US'
    +2234  * KJUR.asn1.x509.X500Name.compatToLDAP("/C=US/O=a,a") → 'O=a\,a,C=US'
    +2235  */
    +2236 KJUR.asn1.x509.X500Name.compatToLDAP = function(s) {
    +2237     if (s.substr(0, 1) !== "/") throw "malformed input";
    +2238 
    +2239     var result = "";
    +2240     s = s.substr(1);
    +2241 
    +2242     var a = s.split("/");
    +2243     a.reverse();
    +2244     a = a.map(function(s) {return s.replace(/,/, "\\,")});
    +2245 
    +2246     return a.join(",");
    +2247 };
    +2248 
    +2249 /**
    +2250  * convert OpenSSL compat distinguished name format string to LDAP(RFC 2253) format (DEPRECATED)<br/>
    +2251  * @name onelineToLDAP
    +2252  * @memberOf KJUR.asn1.x509.X500Name
    +2253  * @function
    +2254  * @param {String} s distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2255  * @return {String} distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2256  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2257  * @see KJUR.asn1.x509.X500Name.compatToLDAP
    +2258  * @description
    +2259  * This method is deprecated. Please use 
    +2260  * {@link KJUR.asn1.x509.X500Name.compatToLDAP} instead.
    +2261  */
    +2262 KJUR.asn1.x509.X500Name.onelineToLDAP = function(s) {
    +2263     return KJUR.asn1.x509.X500Name.compatToLDAP(s);
    +2264 }
    +2265 
    +2266 /**
    +2267  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format<br/>
    +2268  * @name ldapToCompat
    +2269  * @memberOf KJUR.asn1.x509.X500Name
    +2270  * @function
    +2271  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2272  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2273  * @since jsrsasign 8.0.19 asn1x509 1.1.10
    +2274  * @description
    +2275  * This static method converts a distinguished name string in 
    +2276  * LDAP(RFC 2253) format to OpenSSL compat format.
    +2277  * @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>
    +2278  * @example
    +2279  * KJUR.asn1.x509.X500Name.ldapToCompat('O=test,C=US') → '/C=US/O=test'
    +2280  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a\,a,C=US') → '/C=US/O=a,a'
    +2281  * KJUR.asn1.x509.X500Name.ldapToCompat('O=a/a,C=US')  → '/C=US/O=a\/a'
    +2282  */
    +2283 KJUR.asn1.x509.X500Name.ldapToCompat = function(s) {
    +2284     var a = s.split(",");
    +2285 
    +2286     // join \,
    +2287     var isBSbefore = false;
    +2288     var a2 = [];
    +2289     for (var i = 0; a.length > 0; i++) {
    +2290 	var item = a.shift();
    +2291 	//console.log("item=" + item);
    +2292 
    +2293 	if (isBSbefore === true) {
    +2294 	    var a2last = a2.pop();
    +2295 	    var newitem = (a2last + "," + item).replace(/\\,/g, ",");
    +2296 	    a2.push(newitem);
    +2297 	    isBSbefore = false;
    +2298 	} else {
    +2299 	    a2.push(item);
    +2300 	}
    +2301 
    +2302 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    +2303     }
    +2304 
    +2305     a2 = a2.map(function(s) {return s.replace("/", "\\/")});
    +2306     a2.reverse();
    +2307     return "/" + a2.join("/");
    +2308 };
    +2309 
    +2310 /**
    +2311  * convert LDAP(RFC 2253) distinguished name format string to OpenSSL compat format (DEPRECATED)<br/>
    +2312  * @name ldapToOneline
    +2313  * @memberOf KJUR.asn1.x509.X500Name
    +2314  * @function
    +2315  * @param {String} s distinguished name string in LDAP(RFC 2253) format (ex. O=test,C=US)
    +2316  * @return {String} distinguished name string in OpenSSL compat format (ex. /C=US/O=test)
    +2317  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    +2318  * @description
    +2319  * This method is deprecated. Please use 
    +2320  * {@link KJUR.asn1.x509.X500Name.ldapToCompat} instead.
    +2321  */
    +2322 KJUR.asn1.x509.X500Name.ldapToOneline = function(s) {
    +2323     return KJUR.asn1.x509.X500Name.ldapToCompat(s);
    +2324 };
    +2325 
    +2326 /**
    +2327  * RDN (Relative Distinguished Name) ASN.1 structure class
    +2328  * @name KJUR.asn1.x509.RDN
    +2329  * @class RDN (Relative Distinguished Name) ASN.1 structure class
    +2330  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    +2331  * @extends KJUR.asn1.ASN1Object
    +2332  * @see KJUR.asn1.x509.X500Name
    +2333  * @see KJUR.asn1.x509.RDN
    +2334  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +2335  * @description
    +2336  * This class provides RelativeDistinguishedName ASN.1 class structure
    +2337  * defined in <a href="https://tools.ietf.org/html/rfc2253#section-2">RFC 2253 section 2</a>.
    +2338  * <blockquote><pre>
    +2339  * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
    +2340  *   AttributeTypeAndValue
    +2341  *
    +2342  * AttributeTypeAndValue ::= SEQUENCE {
    +2343  *   type  AttributeType,
    +2344  *   value AttributeValue }
    +2345  * </pre></blockquote>
    +2346  * <br/>
    +2347  * NOTE: Multi-valued RDN is supported since jsrsasign 6.2.1 asn1x509 1.0.17.
    +2348  * @example
    +2349  * rdn = new KJUR.asn1.x509.RDN({str: "CN=test"});
    +2350  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=bb+O=c"}); // multi-valued
    +2351  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=b\\+b+O=c"}); // plus escaped
    +2352  * rdn = new KJUR.asn1.x509.RDN({str: "O=a+O=\"b+b\"+O=c"}); // double quoted
    +2353  */
    +2354 KJUR.asn1.x509.RDN = function(params) {
    +2355     KJUR.asn1.x509.RDN.superclass.constructor.call(this);
    +2356     this.asn1Array = new Array();
    +2357 
    +2358     /**
    +2359      * add one AttributeTypeAndValue by string<br/>
    +2360      * @name addByString
    +2361      * @memberOf KJUR.asn1.x509.RDN#
    +2362      * @function
    +2363      * @param {String} s string of AttributeTypeAndValue
    +2364      * @return {Object} unspecified
    +2365      * @description
    +2366      * This method add one AttributeTypeAndValue to RDN object.
    +2367      * @example
    +2368      * rdn = new KJUR.asn1.x509.RDN();
    +2369      * rdn.addByString("CN=john");
    +2370      * rdn.addByString("serialNumber=1234"); // for multi-valued RDN
    +2371      */
    +2372     this.addByString = function(s) {
    +2373         this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({'str': s}));
    +2374     };
    +2375 
    +2376     /**
    +2377      * add one AttributeTypeAndValue by multi-valued string<br/>
    +2378      * @name addByMultiValuedString
    +2379      * @memberOf KJUR.asn1.x509.RDN#
    +2380      * @function
    +2381      * @param {String} s string of multi-valued RDN
    +2382      * @return {Object} unspecified
    +2383      * @since jsrsasign 6.2.1 asn1x509 1.0.17
    +2384      * @description
    +2385      * This method add multi-valued RDN to RDN object.
    +2386      * @example
    +2387      * rdn = new KJUR.asn1.x509.RDN();
    +2388      * rdn.addByMultiValuedString("CN=john+O=test");
    +2389      * rdn.addByMultiValuedString("O=a+O=b\+b\+b+O=c"); // multi-valued RDN with quoted plus
    +2390      * rdn.addByMultiValuedString("O=a+O=\"b+b+b\"+O=c"); // multi-valued RDN with quoted quotation
    +2391      */
    +2392     this.addByMultiValuedString = function(s) {
    +2393 	var a = KJUR.asn1.x509.RDN.parseString(s);
    +2394 	for (var i = 0; i < a.length; i++) {
    +2395 	    this.addByString(a[i]);
    +2396 	}
    +2397     };
    +2398 
    +2399     this.getEncodedHex = function() {
    +2400         var o = new KJUR.asn1.DERSet({"array": this.asn1Array});
    +2401         this.TLV = o.getEncodedHex();
    +2402         return this.TLV;
    +2403     };
    +2404 
    +2405     if (params !== undefined) {
    +2406         if (params.str !== undefined) {
    +2407             this.addByMultiValuedString(params.str);
    +2408         }
    +2409     }
    +2410 };
    +2411 YAHOO.lang.extend(KJUR.asn1.x509.RDN, KJUR.asn1.ASN1Object);
    +2412 
    +2413 /**
    +2414  * parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'<br/>
    +2415  * @name parseString
    +2416  * @memberOf KJUR.asn1.x509.RDN
    +2417  * @function
    +2418  * @param {String} s multi-valued string of RDN
    +2419  * @return {Array} array of string of AttributeTypeAndValue
    +2420  * @since jsrsasign 6.2.1 asn1x509 1.0.17
    +2421  * @description
    +2422  * This static method parses multi-valued RDN string and split into
    +2423  * array of AttributeTypeAndValue.
    +2424  * @example
    +2425  * KJUR.asn1.x509.RDN.parseString("CN=john") → ["CN=john"]
    +2426  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test") → ["CN=john", "OU=test"]
    +2427  * KJUR.asn1.x509.RDN.parseString('CN="jo+hn"+OU=test') → ["CN=jo+hn", "OU=test"]
    +2428  * KJUR.asn1.x509.RDN.parseString('CN=jo\+hn+OU=test') → ["CN=jo+hn", "OU=test"]
    +2429  * KJUR.asn1.x509.RDN.parseString("CN=john+OU=test+OU=t1") → ["CN=john", "OU=test", "OU=t1"]
    +2430  */
    +2431 KJUR.asn1.x509.RDN.parseString = function(s) {
    +2432     var a = s.split(/\+/);
    +2433 
    +2434     // join \+
    +2435     var isBSbefore = false;
    +2436     var a2 = [];
    +2437     for (var i = 0; a.length > 0; i++) {
    +2438 	var item = a.shift();
    +2439 	//console.log("item=" + item);
    +2440 
    +2441 	if (isBSbefore === true) {
    +2442 	    var a2last = a2.pop();
    +2443 	    var newitem = (a2last + "+" + item).replace(/\\\+/g, "+");
    +2444 	    a2.push(newitem);
    +2445 	    isBSbefore = false;
    +2446 	} else {
    +2447 	    a2.push(item);
    +2448 	}
    +2449 
    +2450 	if (item.substr(-1, 1) === "\\") isBSbefore = true;
    +2451     }
    +2452 
    +2453     // join quote
    +2454     var beginQuote = false;
    +2455     var a3 = [];
    +2456     for (var i = 0; a2.length > 0; i++) {
    +2457 	var item = a2.shift();
    +2458 
    +2459 	if (beginQuote === true) {
    +2460 	    var a3last = a3.pop();
    +2461 	    if (item.match(/"$/)) {
    +2462 		var newitem = (a3last + "+" + item).replace(/^([^=]+)="(.*)"$/, "$1=$2");
    +2463 		a3.push(newitem);
    +2464 		beginQuote = false;
    +2465 	    } else {
    +2466 		a3.push(a3last + "+" + item);
    +2467 	    }
    +2468 	} else {
    +2469 	    a3.push(item);
    +2470 	}
    +2471 
    +2472 	if (item.match(/^[^=]+="/)) {
    +2473 	    //console.log(i + "=" + item);
    +2474 	    beginQuote = true;
    +2475 	}
    +2476     }
    +2477 
    +2478     return a3;
    +2479 };
    +2480 
    +2481 /**
    +2482  * AttributeTypeAndValue ASN.1 structure class
    +2483  * @name KJUR.asn1.x509.AttributeTypeAndValue
    +2484  * @class AttributeTypeAndValue ASN.1 structure class
    +2485  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
    +2486  * @extends KJUR.asn1.ASN1Object
    +2487  * @description
    +2488  * @see KJUR.asn1.x509.X500Name
    +2489  * @see KJUR.asn1.x509.RDN
    +2490  * @see KJUR.asn1.x509.AttributeTypeAndValue
    +2491  * @example
    +2492  */
    +2493 KJUR.asn1.x509.AttributeTypeAndValue = function(params) {
    +2494     KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);
    +2495     var typeObj = null,
    +2496 	valueObj = null,
    +2497 	defaultDSType = "utf8",
    +2498 	_KJUR = KJUR,
    +2499 	_KJUR_asn1 = _KJUR.asn1;
    +2500 
    +2501     this.setByString = function(attrTypeAndValueStr) {
    +2502         var matchResult = attrTypeAndValueStr.match(/^([^=]+)=(.+)$/);
    +2503         if (matchResult) {
    +2504             this.setByAttrTypeAndValueStr(matchResult[1], matchResult[2]);
    +2505         } else {
    +2506             throw "malformed attrTypeAndValueStr: " + attrTypeAndValueStr;
    +2507         }
    +2508     };
    +2509 
    +2510     this.setByAttrTypeAndValueStr = function(shortAttrType, valueStr) {
    +2511         this.typeObj = KJUR.asn1.x509.OID.atype2obj(shortAttrType);
    +2512         var dsType = defaultDSType;
    +2513         if (shortAttrType == "C") dsType = "prn";
    +2514         this.valueObj = this.getValueObj(dsType, valueStr);
    +2515     };
    +2516 
    +2517     this.getValueObj = function(dsType, valueStr) {
    +2518         if (dsType == "utf8")   return new _KJUR_asn1.DERUTF8String({"str": valueStr});
    +2519         if (dsType == "prn")    return new _KJUR_asn1.DERPrintableString({"str": valueStr});
    +2520         if (dsType == "tel")    return new _KJUR_asn1.DERTeletexString({"str": valueStr});
    +2521         if (dsType == "ia5")    return new _KJUR_asn1.DERIA5String({"str": valueStr});
    +2522         throw "unsupported directory string type: type=" + dsType + " value=" + valueStr;
    +2523     };
    +2524 
    +2525     this.getEncodedHex = function() {
    +2526         var o = new _KJUR_asn1.DERSequence({"array": [this.typeObj, this.valueObj]});
    +2527         this.TLV = o.getEncodedHex();
    +2528         return this.TLV;
    +2529     };
    +2530 
    +2531     if (params !== undefined) {
    +2532         if (params.str !== undefined) {
    +2533             this.setByString(params.str);
    +2534         }
    +2535     }
    +2536 };
    +2537 YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue, KJUR.asn1.ASN1Object);
    +2538 
    +2539 // === END   X500Name Related =================================================
     2540 
    -2541 	if (params === undefined) return;
    +2541 // === BEGIN Other ASN1 structure class  ======================================
     2542 
    -2543         if (params.rfc822 !== undefined) {
    -2544             this.type = 'rfc822';
    -2545             v = new _DERIA5String({str: params[this.type]});
    -2546         }
    -2547 
    -2548         if (params.dns !== undefined) {
    -2549             this.type = 'dns';
    -2550             v = new _DERIA5String({str: params[this.type]});
    -2551         }
    -2552 
    -2553         if (params.uri !== undefined) {
    -2554             this.type = 'uri';
    -2555             v = new _DERIA5String({str: params[this.type]});
    -2556         }
    -2557 
    -2558         if (params.dn !== undefined) {
    -2559 	    this.type = 'dn';
    -2560 	    this.explicit = true;
    -2561 	    if (typeof params.dn === "string") {
    -2562 		v = new _X500Name({str: params.dn});
    -2563 	    } else if (params.dn instanceof KJUR.asn1.x509.X500Name) {
    -2564 		v = params.dn;
    -2565 	    } else {
    -2566 		v = new _X500Name(params.dn);
    -2567 	    }
    -2568 	}
    -2569 
    -2570         if (params.ldapdn !== undefined) {
    -2571 	    this.type = 'dn';
    -2572 	    this.explicit = true;
    -2573 	    v = new _X500Name({ldapstr: params.ldapdn});
    -2574 	}
    -2575 
    -2576 	if (params.certissuer !== undefined) {
    -2577 	    this.type = 'dn';
    -2578 	    this.explicit = true;
    -2579 	    var certStr = params.certissuer;
    -2580 	    var certHex = null;
    -2581 
    -2582 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    -2583 		certHex == certStr;
    -2584             }
    -2585 
    -2586 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    -2587 		certHex = _pemtohex(certStr);
    -2588 	    }
    -2589 
    -2590 	    if (certHex == null) throw "certissuer param not cert";
    -2591 	    var x = new X509();
    -2592 	    x.hex = certHex;
    -2593 	    var dnHex = x.getIssuerHex();
    -2594 	    v = new _ASN1Object();
    -2595 	    v.hTLV = dnHex;
    -2596 	}
    -2597 
    -2598 	if (params.certsubj !== undefined) {
    -2599 	    this.type = 'dn';
    -2600 	    this.explicit = true;
    -2601 	    var certStr = params.certsubj;
    -2602 	    var certHex = null;
    -2603 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    -2604 		certHex == certStr;
    -2605             }
    -2606 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    -2607 		certHex = _pemtohex(certStr);
    -2608 	    }
    -2609 	    if (certHex == null) throw "certsubj param not cert";
    -2610 	    var x = new X509();
    -2611 	    x.hex = certHex;
    -2612 	    var dnHex = x.getSubjectHex();
    -2613 	    v = new _ASN1Object();
    -2614 	    v.hTLV = dnHex;
    -2615 	}
    -2616 
    -2617 	if (params.ip !== undefined) {
    -2618 	    this.type = 'ip';
    -2619 	    this.explicit = false;
    -2620 	    var ip = params.ip;
    -2621 	    var hIP;
    -2622 	    var malformedIPMsg = "malformed IP address";
    -2623 	    if (ip.match(/^[0-9.]+[.][0-9.]+$/)) { // ipv4
    -2624 		hIP = intarystrtohex("[" + ip.split(".").join(",") + "]");
    -2625 		if (hIP.length !== 8) throw malformedIPMsg;
    -2626 	    } else if (ip.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)) { // ipv6
    -2627 		hIP = ipv6tohex(ip);
    -2628 	    } else if (ip.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)) { // hex
    -2629 		hIP = ip;
    -2630 	    } else {
    -2631 		throw malformedIPMsg;
    -2632 	    }
    -2633 	    v = new _DEROctetString({hex: hIP});
    -2634 	}
    -2635 
    -2636         if (this.type == null)
    -2637             throw "unsupported type in params=" + params;
    -2638         this.asn1Obj = new _DERTaggedObject({'explicit': this.explicit,
    -2639                                              'tag': pTag[this.type],
    -2640                                              'obj': v});
    -2641     };
    -2642 
    -2643     this.getEncodedHex = function() {
    -2644         return this.asn1Obj.getEncodedHex();
    -2645     }
    -2646 
    -2647     if (params !== undefined) {
    -2648         this.setByParam(params);
    -2649     }
    +2543 /**
    +2544  * SubjectPublicKeyInfo ASN.1 structure class
    +2545  * @name KJUR.asn1.x509.SubjectPublicKeyInfo
    +2546  * @class SubjectPublicKeyInfo ASN.1 structure class
    +2547  * @param {Object} params parameter for subject public key
    +2548  * @extends KJUR.asn1.ASN1Object
    +2549  * @description
    +2550  * <br/>
    +2551  * As for argument 'params' for constructor, you can specify one of
    +2552  * following properties:
    +2553  * <ul>
    +2554  * <li>{@link RSAKey} object</li>
    +2555  * <li>{@link KJUR.crypto.ECDSA} object</li>
    +2556  * <li>{@link KJUR.crypto.DSA} object</li>
    +2557  * </ul>
    +2558  * NOTE1: 'params' can be omitted.<br/>
    +2559  * NOTE2: DSA/ECDSA key object is also supported since asn1x509 1.0.6.<br/>
    +2560  * <h4>EXAMPLE</h4>
    +2561  * @example
    +2562  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(RSAKey_object);
    +2563  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoECDSA_object);
    +2564  * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoDSA_object);
    +2565  */
    +2566 KJUR.asn1.x509.SubjectPublicKeyInfo = function(params) {
    +2567     KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);
    +2568     var asn1AlgId = null,
    +2569 	asn1SubjPKey = null,
    +2570 	_KJUR = KJUR,
    +2571 	_KJUR_asn1 = _KJUR.asn1,
    +2572 	_DERInteger = _KJUR_asn1.DERInteger,
    +2573 	_DERBitString = _KJUR_asn1.DERBitString,
    +2574 	_DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier,
    +2575 	_DERSequence = _KJUR_asn1.DERSequence,
    +2576 	_newObject = _KJUR_asn1.ASN1Util.newObject,
    +2577 	_KJUR_asn1_x509 = _KJUR_asn1.x509,
    +2578 	_AlgorithmIdentifier = _KJUR_asn1_x509.AlgorithmIdentifier,
    +2579 	_KJUR_crypto = _KJUR.crypto,
    +2580 	_KJUR_crypto_ECDSA = _KJUR_crypto.ECDSA,
    +2581 	_KJUR_crypto_DSA = _KJUR_crypto.DSA;
    +2582 
    +2583     /*
    +2584      * @since asn1x509 1.0.7
    +2585      */
    +2586     this.getASN1Object = function() {
    +2587         if (this.asn1AlgId == null || this.asn1SubjPKey == null)
    +2588             throw "algId and/or subjPubKey not set";
    +2589         var o = new _DERSequence({'array':
    +2590                                   [this.asn1AlgId, this.asn1SubjPKey]});
    +2591         return o;
    +2592     };
    +2593 
    +2594     this.getEncodedHex = function() {
    +2595         var o = this.getASN1Object();
    +2596         this.hTLV = o.getEncodedHex();
    +2597         return this.hTLV;
    +2598     };
    +2599 
    +2600     /**
    +2601      * @name setPubKey
    +2602      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo#
    +2603      * @function
    +2604      * @param {Object} {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object
    +2605      * @since jsrsasign 8.0.0 asn1x509 1.1.0
    +2606      * @description
    +2607      * @example
    +2608      * spki = new KJUR.asn1.x509.SubjectPublicKeyInfo();
    +2609      * pubKey = KEYUTIL.getKey(PKCS8PUBKEYPEM);
    +2610      * spki.setPubKey(pubKey);
    +2611      */
    +2612     this.setPubKey = function(key) {
    +2613 	try {
    +2614 	    if (key instanceof RSAKey) {
    +2615 		var asn1RsaPub = _newObject({
    +2616 		    'seq': [{'int': {'bigint': key.n}}, {'int': {'int': key.e}}]
    +2617 		});
    +2618 		var rsaKeyHex = asn1RsaPub.getEncodedHex();
    +2619 		this.asn1AlgId = new _AlgorithmIdentifier({'name':'rsaEncryption'});
    +2620 		this.asn1SubjPKey = new _DERBitString({'hex':'00'+rsaKeyHex});
    +2621 	    }
    +2622 	} catch(ex) {};
    +2623 
    +2624 	try {
    +2625 	    if (key instanceof KJUR.crypto.ECDSA) {
    +2626 		var asn1Params = new _DERObjectIdentifier({'name': key.curveName});
    +2627 		this.asn1AlgId =
    +2628 		    new _AlgorithmIdentifier({'name': 'ecPublicKey',
    +2629 					      'asn1params': asn1Params});
    +2630 		this.asn1SubjPKey = new _DERBitString({'hex': '00' + key.pubKeyHex});
    +2631 	    }
    +2632 	} catch(ex) {};
    +2633 
    +2634 	try {
    +2635 	    if (key instanceof KJUR.crypto.DSA) {
    +2636 		var asn1Params = new _newObject({
    +2637 		    'seq': [{'int': {'bigint': key.p}},
    +2638 			    {'int': {'bigint': key.q}},
    +2639 			    {'int': {'bigint': key.g}}]
    +2640 		});
    +2641 		this.asn1AlgId =
    +2642 		    new _AlgorithmIdentifier({'name': 'dsa',
    +2643 					      'asn1params': asn1Params});
    +2644 		var pubInt = new _DERInteger({'bigint': key.y});
    +2645 		this.asn1SubjPKey = 
    +2646 		    new _DERBitString({'hex': '00' + pubInt.getEncodedHex()});
    +2647 	    }
    +2648 	} catch(ex) {};
    +2649     };
     2650 
    -2651 };
    -2652 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object);
    -2653 
    -2654 /**
    -2655  * GeneralNames ASN.1 structure class<br/>
    -2656  * @name KJUR.asn1.x509.GeneralNames
    -2657  * @class GeneralNames ASN.1 structure class
    -2658  * @description
    -2659  * <br/>
    -2660  * <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
    -2661  * @example
    -2662  * gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]);
    -2663  *
    -2664  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    -2665  */
    -2666 KJUR.asn1.x509.GeneralNames = function(paramsArray) {
    -2667     KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);
    -2668     var asn1Array = null,
    -2669 	_KJUR = KJUR,
    -2670 	_KJUR_asn1 = _KJUR.asn1;
    -2671 
    -2672     /**
    -2673      * set a array of {@link KJUR.asn1.x509.GeneralName} parameters<br/>
    -2674      * @name setByParamArray
    -2675      * @memberOf KJUR.asn1.x509.GeneralNames#
    -2676      * @function
    -2677      * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames}
    -2678      * @description
    -2679      * <br/>
    -2680      * <h4>EXAMPLES</h4>
    -2681      * @example
    -2682      * gns = new KJUR.asn1.x509.GeneralNames();
    -2683      * gns.setByParamArray([{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]);
    -2684      */
    -2685     this.setByParamArray = function(paramsArray) {
    -2686         for (var i = 0; i < paramsArray.length; i++) {
    -2687             var o = new _KJUR_asn1.x509.GeneralName(paramsArray[i]);
    -2688             this.asn1Array.push(o);
    -2689         }
    -2690     };
    -2691 
    -2692     this.getEncodedHex = function() {
    -2693         var o = new _KJUR_asn1.DERSequence({'array': this.asn1Array});
    -2694         return o.getEncodedHex();
    -2695     };
    -2696 
    -2697     this.asn1Array = new Array();
    -2698     if (typeof paramsArray != "undefined") {
    -2699         this.setByParamArray(paramsArray);
    -2700     }
    -2701 };
    -2702 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object);
    -2703 
    -2704 /**
    -2705  * DistributionPointName ASN.1 structure class<br/>
    -2706  * @name KJUR.asn1.x509.DistributionPointName
    -2707  * @class DistributionPointName ASN.1 structure class
    -2708  * @description
    -2709  * <pre>
    -2710  * DistributionPoint ::= SEQUENCE {
    -2711  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    -2712  *      reasons                 [1]     ReasonFlags OPTIONAL,
    -2713  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    -2714  *
    -2715  * DistributionPointName ::= CHOICE {
    -2716  *      fullName                [0]     GeneralNames,
    -2717  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    -2718  * 
    -2719  * ReasonFlags ::= BIT STRING {
    -2720  *      unused                  (0),
    -2721  *      keyCompromise           (1),
    -2722  *      cACompromise            (2),
    -2723  *      affiliationChanged      (3),
    -2724  *      superseded              (4),
    -2725  *      cessationOfOperation    (5),
    -2726  *      certificateHold         (6),
    -2727  *      privilegeWithdrawn      (7),
    -2728  *      aACompromise            (8) }
    -2729  * </pre>
    -2730  * @example
    -2731  */
    -2732 KJUR.asn1.x509.DistributionPointName = function(gnOrRdn) {
    -2733     KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this);
    -2734     var asn1Obj = null,
    -2735 	type = null,
    -2736 	tag = null,
    -2737 	asn1V = null,
    -2738 	_KJUR = KJUR,
    -2739 	_KJUR_asn1 = _KJUR.asn1,
    -2740 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject;
    -2741 
    -2742     this.getEncodedHex = function() {
    -2743         if (this.type != "full")
    -2744             throw "currently type shall be 'full': " + this.type;
    -2745         this.asn1Obj = new _DERTaggedObject({'explicit': false,
    -2746                                              'tag': this.tag,
    -2747                                              'obj': this.asn1V});
    -2748         this.hTLV = this.asn1Obj.getEncodedHex();
    -2749         return this.hTLV;
    -2750     };
    -2751 
    -2752     if (gnOrRdn !== undefined) {
    -2753         if (_KJUR_asn1.x509.GeneralNames.prototype.isPrototypeOf(gnOrRdn)) {
    -2754             this.type = "full";
    -2755             this.tag = "a0";
    -2756             this.asn1V = gnOrRdn;
    -2757         } else {
    -2758             throw "This class supports GeneralNames only as argument";
    -2759         }
    -2760     }
    -2761 };
    -2762 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object);
    -2763 
    -2764 /**
    -2765  * DistributionPoint ASN.1 structure class<br/>
    -2766  * @name KJUR.asn1.x509.DistributionPoint
    -2767  * @class DistributionPoint ASN.1 structure class
    -2768  * @description
    -2769  * <pre>
    -2770  * DistributionPoint ::= SEQUENCE {
    -2771  *      distributionPoint       [0]     DistributionPointName OPTIONAL,
    -2772  *      reasons                 [1]     ReasonFlags OPTIONAL,
    -2773  *      cRLIssuer               [2]     GeneralNames OPTIONAL }
    -2774  *
    -2775  * DistributionPointName ::= CHOICE {
    -2776  *      fullName                [0]     GeneralNames,
    -2777  *      nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
    -2778  * 
    -2779  * ReasonFlags ::= BIT STRING {
    -2780  *      unused                  (0),
    -2781  *      keyCompromise           (1),
    -2782  *      cACompromise            (2),
    -2783  *      affiliationChanged      (3),
    -2784  *      superseded              (4),
    -2785  *      cessationOfOperation    (5),
    -2786  *      certificateHold         (6),
    -2787  *      privilegeWithdrawn      (7),
    -2788  *      aACompromise            (8) }
    -2789  * </pre>
    -2790  * @example
    -2791  */
    -2792 KJUR.asn1.x509.DistributionPoint = function(params) {
    -2793     KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this);
    -2794     var asn1DP = null,
    -2795 	_KJUR = KJUR,
    -2796 	_KJUR_asn1 = _KJUR.asn1;
    -2797 
    -2798     this.getEncodedHex = function() {
    -2799         var seq = new _KJUR_asn1.DERSequence();
    -2800         if (this.asn1DP != null) {
    -2801             var o1 = new _KJUR_asn1.DERTaggedObject({'explicit': true,
    -2802                                                      'tag': 'a0',
    -2803                                                      'obj': this.asn1DP});
    -2804             seq.appendASN1Object(o1);
    -2805         }
    -2806         this.hTLV = seq.getEncodedHex();
    -2807         return this.hTLV;
    -2808     };
    -2809 
    -2810     if (params !== undefined) {
    -2811         if (params.dpobj !== undefined) {
    -2812             this.asn1DP = params.dpobj;
    -2813         }
    -2814     }
    -2815 };
    -2816 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object);
    -2817 
    -2818 /**
    -2819  * static object for OID
    -2820  * @name KJUR.asn1.x509.OID
    -2821  * @class static object for OID
    -2822  * @property {Assoc Array} atype2oidList for short attribute type name and oid (ex. 'C' and '2.5.4.6')
    -2823  * @property {Assoc Array} name2oidList for oid name and oid (ex. 'keyUsage' and '2.5.29.15')
    -2824  * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object
    -2825  * @description
    -2826  * This class defines OID name and values.
    -2827  * AttributeType names registered in OID.atype2oidList are following:
    -2828  * <table style="border-width: thin; border-style: solid; witdh: 100%">
    -2829  * <tr><th>short</th><th>long</th><th>OID</th></tr>
    -2830  * <tr><td>CN</td>commonName<td></td><td>2.5.4.3</td></tr>
    -2831  * <tr><td>L</td><td>localityName</td><td>2.5.4.7</td></tr>
    -2832  * <tr><td>ST</td><td>stateOrProvinceName</td><td>2.5.4.8</td></tr>
    -2833  * <tr><td>O</td><td>organizationName</td><td>2.5.4.10</td></tr>
    -2834  * <tr><td>OU</td><td>organizationalUnitName</td><td>2.5.4.11</td></tr>
    -2835  * <tr><td>C</td><td></td>countryName<td>2.5.4.6</td></tr>
    -2836  * <tr><td>STREET</td>streetAddress<td></td><td>2.5.4.6</td></tr>
    -2837  * <tr><td>DC</td><td>domainComponent</td><td>0.9.2342.19200300.100.1.25</td></tr>
    -2838  * <tr><td>UID</td><td>userId</td><td>0.9.2342.19200300.100.1.1</td></tr>
    -2839  * <tr><td>SN</td><td>surname</td><td>2.5.4.4</td></tr>
    -2840  * <tr><td>DN</td><td>distinguishedName</td><td>2.5.4.49</td></tr>
    -2841  * <tr><td>E</td><td>emailAddress</td><td>1.2.840.113549.1.9.1</td></tr>
    -2842  * <tr><td></td><td>businessCategory</td><td>2.5.4.15</td></tr>
    -2843  * <tr><td></td><td>postalCode</td><td>2.5.4.17</td></tr>
    -2844  * <tr><td></td><td>jurisdictionOfIncorporationL</td><td>1.3.6.1.4.1.311.60.2.1.1</td></tr>
    -2845  * <tr><td></td><td>jurisdictionOfIncorporationSP</td><td>1.3.6.1.4.1.311.60.2.1.2</td></tr>
    -2846  * <tr><td></td><td>jurisdictionOfIncorporationC</td><td>1.3.6.1.4.1.311.60.2.1.3</td></tr>
    -2847  * </table>
    -2848  *
    -2849  * @example
    -2850  */
    -2851 KJUR.asn1.x509.OID = new function(params) {
    -2852     this.atype2oidList = {
    -2853 	// RFC 4514 AttributeType name string (MUST recognized)
    -2854         'CN':		'2.5.4.3',
    -2855         'L':		'2.5.4.7',
    -2856         'ST':		'2.5.4.8',
    -2857         'O':		'2.5.4.10',
    -2858         'OU':		'2.5.4.11',
    -2859         'C':		'2.5.4.6',
    -2860         'STREET':	'2.5.4.9',
    -2861         'DC':		'0.9.2342.19200300.100.1.25',
    -2862         'UID':		'0.9.2342.19200300.100.1.1',
    -2863 	// other AttributeType name string
    -2864 	// http://blog.livedoor.jp/k_urushima/archives/656114.html
    -2865         'SN':		'2.5.4.4', // surname
    -2866         'T':		'2.5.4.12', // title
    -2867         'DN':		'2.5.4.49', // distinguishedName
    -2868         'E':		'1.2.840.113549.1.9.1', // emailAddress in MS.NET or Bouncy
    -2869 	// other AttributeType name string (no short name)
    -2870 	'description':			'2.5.4.13',
    -2871 	'businessCategory':		'2.5.4.15',
    -2872 	'postalCode':			'2.5.4.17',
    -2873 	'serialNumber':			'2.5.4.5',
    -2874 	'uniqueIdentifier':		'2.5.4.45',
    -2875 	'organizationIdentifier':	'2.5.4.97',
    -2876 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    -2877 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    -2878 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3'
    -2879     };
    -2880     this.name2oidList = {
    -2881         'sha1':                 '1.3.14.3.2.26',
    -2882         'sha256':               '2.16.840.1.101.3.4.2.1',
    -2883         'sha384':               '2.16.840.1.101.3.4.2.2',
    -2884         'sha512':               '2.16.840.1.101.3.4.2.3',
    -2885         'sha224':               '2.16.840.1.101.3.4.2.4',
    -2886         'md5':                  '1.2.840.113549.2.5',
    -2887         'md2':                  '1.3.14.7.2.2.1',
    -2888         'ripemd160':            '1.3.36.3.2.1',
    -2889 
    -2890         'MD2withRSA':           '1.2.840.113549.1.1.2',
    -2891         'MD4withRSA':           '1.2.840.113549.1.1.3',
    -2892         'MD5withRSA':           '1.2.840.113549.1.1.4',
    -2893         'SHA1withRSA':          '1.2.840.113549.1.1.5',
    -2894         'SHA224withRSA':        '1.2.840.113549.1.1.14',
    -2895         'SHA256withRSA':        '1.2.840.113549.1.1.11',
    -2896         'SHA384withRSA':        '1.2.840.113549.1.1.12',
    -2897         'SHA512withRSA':        '1.2.840.113549.1.1.13',
    -2898 
    -2899         'SHA1withECDSA':        '1.2.840.10045.4.1',
    -2900         'SHA224withECDSA':      '1.2.840.10045.4.3.1',
    -2901         'SHA256withECDSA':      '1.2.840.10045.4.3.2',
    -2902         'SHA384withECDSA':      '1.2.840.10045.4.3.3',
    -2903         'SHA512withECDSA':      '1.2.840.10045.4.3.4',
    -2904 
    -2905         'dsa':                  '1.2.840.10040.4.1',
    -2906         'SHA1withDSA':          '1.2.840.10040.4.3',
    -2907         'SHA224withDSA':        '2.16.840.1.101.3.4.3.1',
    -2908         'SHA256withDSA':        '2.16.840.1.101.3.4.3.2',
    -2909 
    -2910         'rsaEncryption':        '1.2.840.113549.1.1.1',
    -2911 
    -2912 	// X.500 AttributeType defined in RFC 4514
    -2913         'commonName':			'2.5.4.3',
    -2914         'countryName':			'2.5.4.6',
    -2915         'localityName':			'2.5.4.7',
    -2916         'stateOrProvinceName':		'2.5.4.8',
    -2917         'streetAddress':		'2.5.4.9',
    -2918         'organizationName':		'2.5.4.10',
    -2919         'organizationalUnitName':	'2.5.4.11',
    -2920         'domainComponent':		'0.9.2342.19200300.100.1.25',
    -2921         'userId':			'0.9.2342.19200300.100.1.1',
    -2922 	// other AttributeType name string
    -2923 	'surname':			'2.5.4.4',
    -2924         'title':			'2.5.4.12',
    -2925 	'distinguishedName':		'2.5.4.49',
    -2926 	'emailAddress':			'1.2.840.113549.1.9.1',
    -2927 	// other AttributeType name string (no short name)
    -2928 	'description':			'2.5.4.13',
    -2929 	'businessCategory':		'2.5.4.15',
    -2930 	'postalCode':			'2.5.4.17',
    -2931 	'uniqueIdentifier':		'2.5.4.45',
    -2932 	'organizationIdentifier':	'2.5.4.97',
    -2933 	'jurisdictionOfIncorporationL':	'1.3.6.1.4.1.311.60.2.1.1',
    -2934 	'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2',
    -2935 	'jurisdictionOfIncorporationC':	'1.3.6.1.4.1.311.60.2.1.3',
    +2651     if (params !== undefined) {
    +2652 	this.setPubKey(params);
    +2653     }
    +2654 };
    +2655 YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo, KJUR.asn1.ASN1Object);
    +2656 
    +2657 /**
    +2658  * Time ASN.1 structure class
    +2659  * @name KJUR.asn1.x509.Time
    +2660  * @class Time ASN.1 structure class
    +2661  * @param {Array} params associative array of parameters (ex. {'str': '130508235959Z'})
    +2662  * @extends KJUR.asn1.ASN1Object
    +2663  * @description
    +2664  * <br/>
    +2665  * <h4>EXAMPLES</h4>
    +2666  * @example
    +2667  * var t1 = new KJUR.asn1.x509.Time{'str': '130508235959Z'} // UTCTime by default
    +2668  * var t2 = new KJUR.asn1.x509.Time{'type': 'gen',  'str': '20130508235959Z'} // GeneralizedTime
    +2669  */
    +2670 KJUR.asn1.x509.Time = function(params) {
    +2671     KJUR.asn1.x509.Time.superclass.constructor.call(this);
    +2672     var type = null,
    +2673 	timeParams = null,
    +2674 	_KJUR = KJUR,
    +2675 	_KJUR_asn1 = _KJUR.asn1,
    +2676 	_DERUTCTime = _KJUR_asn1.DERUTCTime,
    +2677 	_DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime;
    +2678 
    +2679     this.setTimeParams = function(timeParams) {
    +2680         this.timeParams = timeParams;
    +2681     }
    +2682 
    +2683     this.getEncodedHex = function() {
    +2684         var o = null;
    +2685 
    +2686         if (this.timeParams != null) {
    +2687             if (this.type == "utc") {
    +2688                 o = new _DERUTCTime(this.timeParams);
    +2689             } else {
    +2690                 o = new _DERGeneralizedTime(this.timeParams);
    +2691             }
    +2692         } else {
    +2693             if (this.type == "utc") {
    +2694                 o = new _DERUTCTime();
    +2695             } else {
    +2696                 o = new _DERGeneralizedTime();
    +2697             }
    +2698         }
    +2699         this.TLV = o.getEncodedHex();
    +2700         return this.TLV;
    +2701     };
    +2702 
    +2703     this.type = "utc";
    +2704     if (params !== undefined) {
    +2705         if (params.type !== undefined) {
    +2706             this.type = params.type;
    +2707         } else {
    +2708             if (params.str !== undefined) {
    +2709                 if (params.str.match(/^[0-9]{12}Z$/)) this.type = "utc";
    +2710                 if (params.str.match(/^[0-9]{14}Z$/)) this.type = "gen";
    +2711             }
    +2712         }
    +2713         this.timeParams = params;
    +2714     }
    +2715 };
    +2716 YAHOO.lang.extend(KJUR.asn1.x509.Time, KJUR.asn1.ASN1Object);
    +2717 
    +2718 /**
    +2719  * AlgorithmIdentifier ASN.1 structure class
    +2720  * @name KJUR.asn1.x509.AlgorithmIdentifier
    +2721  * @class AlgorithmIdentifier ASN.1 structure class
    +2722  * @param {Array} params associative array of parameters (ex. {'name': 'SHA1withRSA'})
    +2723  * @extends KJUR.asn1.ASN1Object
    +2724  * @description
    +2725  * The 'params' argument is an associative array and has following parameters:
    +2726  * <ul>
    +2727  * <li>name: algorithm name (MANDATORY, ex. sha1, SHA256withRSA)</li>
    +2728  * <li>asn1params: explicitly specify ASN.1 object for algorithm.
    +2729  * (OPTION)</li>
    +2730  * <li>paramempty: set algorithm parameter to NULL by force.
    +2731  * If paramempty is false, algorithm parameter will be set automatically.
    +2732  * If paramempty is false and algorithm name is "*withDSA" or "withECDSA" parameter field of
    +2733  * AlgorithmIdentifier will be ommitted otherwise
    +2734  * it will be NULL by default.
    +2735  * (OPTION, DEFAULT = false)</li>
    +2736  * </ul>
    +2737  * RSA-PSS algorithm names such as SHA{,256,384,512}withRSAandMGF1 are
    +2738  * special names. They will set a suite of algorithm OID and multiple algorithm
    +2739  * parameters. Its ASN.1 schema is defined in 
    +2740  * <a href="https://tools.ietf.org/html/rfc3447#appendix-A.2.3">RFC 3447 PKCS#1 2.1
    +2741  * section A.2.3</a>.
    +2742  * <blockquote><pre>
    +2743  * id-RSASSA-PSS  OBJECT IDENTIFIER ::= { pkcs-1 10 }
    +2744  * RSASSA-PSS-params ::= SEQUENCE {
    +2745  *   hashAlgorithm      [0] HashAlgorithm    DEFAULT sha1,
    +2746  *   maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
    +2747  *   saltLength         [2] INTEGER          DEFAULT 20,
    +2748  *   trailerField       [3] TrailerField     DEFAULT trailerFieldBC }
    +2749  * mgf1SHA1    MaskGenAlgorithm ::= {
    +2750  *   algorithm   id-mgf1,
    +2751  *   parameters  HashAlgorithm : sha1 }
    +2752  * id-mgf1     OBJECT IDENTIFIER ::= { pkcs-1 8 }
    +2753  * TrailerField ::= INTEGER { trailerFieldBC(1) }
    +2754  * </pre></blockquote>
    +2755  * Here is a table for PSS parameters:
    +2756  * <table>
    +2757  * <tr><th>Name</th><th>alg oid</th><th>pss hash</th><th>maskgen</th></th><th>pss saltlen</th><th>trailer</th></tr>
    +2758  * <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>
    +2759  * <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>
    +2760  * <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>
    +2761  * <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>
    +2762  * </table>
    +2763  * Default value is omitted as defined in ASN.1 schema.
    +2764  * These parameters are interoperable to OpenSSL or IAIK toolkit.
    +2765  * <br/>
    +2766  * NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21. 
    +2767  * @example
    +2768  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"})
    +2769  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA"})
    +2770  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA512withRSAandMGF1"}) // set parameters automatically
    +2771  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA", paramempty: true})
    +2772  * new KJUR.asn1.x509.AlgorithmIdentifier({name: "rsaEncryption"})
    +2773  */
    +2774 KJUR.asn1.x509.AlgorithmIdentifier = function(params) {
    +2775     KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);
    +2776     this.nameAlg = null;
    +2777     this.asn1Alg = null;
    +2778     this.asn1Params = null;
    +2779     this.paramEmpty = false;
    +2780 
    +2781     var _KJUR = KJUR,
    +2782 	_KJUR_asn1 = _KJUR.asn1,
    +2783 	_PSSNAME2ASN1TLV = _KJUR_asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;
    +2784 
    +2785     this.getEncodedHex = function() {
    +2786         if (this.nameAlg === null && this.asn1Alg === null) {
    +2787             throw new Error("algorithm not specified");
    +2788         }
    +2789 
    +2790 	// for RSAPSS algorithm name
    +2791 	//  && this.hTLV === null
    +2792 	if (this.nameAlg !== null) {
    +2793 	    var hTLV = null;
    +2794 	    for (var key in _PSSNAME2ASN1TLV) {
    +2795 		if (key === this.nameAlg) {
    +2796 		    hTLV = _PSSNAME2ASN1TLV[key];
    +2797 		}
    +2798 	    }
    +2799 	    if (hTLV !== null) {
    +2800 		this.hTLV = hTLV;
    +2801 		return this.hTLV;
    +2802 	    }
    +2803 	}
    +2804 
    +2805         if (this.nameAlg !== null && this.asn1Alg === null) {
    +2806             this.asn1Alg = _KJUR_asn1.x509.OID.name2obj(this.nameAlg);
    +2807         }
    +2808         var a = [this.asn1Alg];
    +2809         if (this.asn1Params !== null) a.push(this.asn1Params);
    +2810 
    +2811         var o = new _KJUR_asn1.DERSequence({'array': a});
    +2812         this.hTLV = o.getEncodedHex();
    +2813         return this.hTLV;
    +2814     };
    +2815 
    +2816     if (params !== undefined) {
    +2817         if (params.name !== undefined) {
    +2818             this.nameAlg = params.name;
    +2819         }
    +2820         if (params.asn1params !== undefined) {
    +2821             this.asn1Params = params.asn1params;
    +2822         }
    +2823         if (params.paramempty !== undefined) {
    +2824             this.paramEmpty = params.paramempty;
    +2825         }
    +2826     }
    +2827 
    +2828     // set algorithm parameters will be ommitted for
    +2829     // "*withDSA" or "*withECDSA" otherwise will be NULL.
    +2830     if (this.asn1Params === null &&
    +2831 	this.paramEmpty === false &&
    +2832 	this.nameAlg !== null) {
    +2833 	var lcNameAlg = this.nameAlg.toLowerCase();
    +2834 	if (lcNameAlg.substr(-7, 7) !== "withdsa" &&
    +2835 	    lcNameAlg.substr(-9, 9) !== "withecdsa") {
    +2836             this.asn1Params = new _KJUR_asn1.DERNull();
    +2837 	}
    +2838     }
    +2839 };
    +2840 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object);
    +2841 
    +2842 /**
    +2843  * AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names
    +2844  * @const
    +2845  */
    +2846 KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV = {
    +2847     "SHAwithRSAandMGF1":
    +2848     "300d06092a864886f70d01010a3000",
    +2849     "SHA256withRSAandMGF1":
    +2850     "303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",
    +2851     "SHA384withRSAandMGF1":
    +2852     "303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",
    +2853     "SHA512withRSAandMGF1":
    +2854     "303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"
    +2855 };
    +2856 
    +2857 /**
    +2858  * GeneralName ASN.1 structure class<br/>
    +2859  * @name KJUR.asn1.x509.GeneralName
    +2860  * @class GeneralName ASN.1 structure class
    +2861  * @description
    +2862  * <br/>
    +2863  * As for argument 'params' for constructor, you can specify one of
    +2864  * following properties:
    +2865  * <ul>
    +2866  * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li>
    +2867  * <li>dns - dNSName[2] (ex. foo.com)</li>
    +2868  * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li>
    +2869  * <li>dn - directoryName[4] 
    +2870  * distinguished name string or X500Name class parameters can be
    +2871  * specified (ex. "/C=US/O=Test", {hex: '301c...')</li>
    +2872  * <li>ldapdn - directoryName[4] (ex. O=Test,C=US)</li>
    +2873  * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li>
    +2874  * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li>
    +2875  * <li>ip - iPAddress[7] (ex. 192.168.1.1, 2001:db3::43, 3faa0101...)</li>
    +2876  * </ul>
    +2877  * NOTE1: certissuer and certsubj were supported since asn1x509 1.0.10.<br/>
    +2878  * NOTE2: dn and ldapdn were supported since jsrsasign 6.2.3 asn1x509 1.0.19.<br/>
    +2879  * NOTE3: ip were supported since jsrsasign 8.0.10 asn1x509 1.1.4.<br/>
    +2880  * NOTE4: X500Name parameters in dn were supported since jsrsasign 8.0.16.<br/>
    +2881  *
    +2882  * Here is definition of the ASN.1 syntax:
    +2883  * <pre>
    +2884  * -- NOTE: under the CHOICE, it will always be explicit.
    +2885  * GeneralName ::= CHOICE {
    +2886  *   otherName                  [0] OtherName,
    +2887  *   rfc822Name                 [1] IA5String,
    +2888  *   dNSName                    [2] IA5String,
    +2889  *   x400Address                [3] ORAddress,
    +2890  *   directoryName              [4] Name,
    +2891  *   ediPartyName               [5] EDIPartyName,
    +2892  *   uniformResourceIdentifier  [6] IA5String,
    +2893  *   iPAddress                  [7] OCTET STRING,
    +2894  *   registeredID               [8] OBJECT IDENTIFIER }
    +2895  * </pre>
    +2896  *
    +2897  * @example
    +2898  * gn = new KJUR.asn1.x509.GeneralName({dn:     '/C=US/O=Test'});
    +2899  * gn = new KJUR.asn1.x509.GeneralName({dn:     X500NameObject);
    +2900  * gn = new KJUR.asn1.x509.GeneralName({dn:     {str: /C=US/O=Test'});
    +2901  * gn = new KJUR.asn1.x509.GeneralName({dn:     {ldapstr: 'O=Test,C=US'});
    +2902  * gn = new KJUR.asn1.x509.GeneralName({dn:     {hex: '301c...'});
    +2903  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certissuer: PEMCERTSTRING});
    +2904  * gn = new KJUR.asn1.x509.GeneralName({dn:     {certsubject: PEMCERTSTRING});
    +2905  * gn = new KJUR.asn1.x509.GeneralName({ip:     '192.168.1.1'});
    +2906  * gn = new KJUR.asn1.x509.GeneralName({ip:     '2001:db4::4:1'});
    +2907  * gn = new KJUR.asn1.x509.GeneralName({ip:     'c0a80101'});
    +2908  * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'});
    +2909  * gn = new KJUR.asn1.x509.GeneralName({dns:    'aaa.com'});
    +2910  * gn = new KJUR.asn1.x509.GeneralName({uri:    'http://aaa.com/'});
    +2911  *
    +2912  * gn = new KJUR.asn1.x509.GeneralName({ldapdn:     'O=Test,C=US'}); // DEPRECATED
    +2913  * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM});       // DEPRECATED
    +2914  * gn = new KJUR.asn1.x509.GeneralName({certsubj:   certPEM});       // DEPRECATED
    +2915  */
    +2916 KJUR.asn1.x509.GeneralName = function(params) {
    +2917     KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);
    +2918     var asn1Obj = null,
    +2919 	type = null,
    +2920 	pTag = {rfc822: '81', dns: '82', dn: 'a4',  uri: '86', ip: '87'},
    +2921 	_KJUR = KJUR,
    +2922 	_KJUR_asn1 = _KJUR.asn1,
    +2923 	_DERSequence = _KJUR_asn1.DERSequence,
    +2924 	_DEROctetString = _KJUR_asn1.DEROctetString,
    +2925 	_DERIA5String = _KJUR_asn1.DERIA5String,
    +2926 	_DERTaggedObject = _KJUR_asn1.DERTaggedObject,
    +2927 	_ASN1Object = _KJUR_asn1.ASN1Object,
    +2928 	_X500Name = _KJUR_asn1.x509.X500Name,
    +2929 	_pemtohex = pemtohex;
    +2930 	
    +2931     this.explicit = false;
    +2932 
    +2933     this.setByParam = function(params) {
    +2934         var str = null;
    +2935         var v = null;
     2936 
    -2937         'subjectKeyIdentifier': '2.5.29.14',
    -2938         'keyUsage':             '2.5.29.15',
    -2939         'subjectAltName':       '2.5.29.17',
    -2940         'issuerAltName':        '2.5.29.18',
    -2941         'basicConstraints':     '2.5.29.19',
    -2942         'nameConstraints':      '2.5.29.30',
    -2943         'cRLDistributionPoints':'2.5.29.31',
    -2944         'certificatePolicies':  '2.5.29.32',
    -2945         'authorityKeyIdentifier':'2.5.29.35',
    -2946         'policyConstraints':    '2.5.29.36',
    -2947         'extKeyUsage':          '2.5.29.37',
    -2948         'authorityInfoAccess':  '1.3.6.1.5.5.7.1.1',
    -2949         'ocsp':                 '1.3.6.1.5.5.7.48.1',
    -2950         'caIssuers':            '1.3.6.1.5.5.7.48.2',
    -2951 
    -2952         'anyExtendedKeyUsage':  '2.5.29.37.0',
    -2953         'serverAuth':           '1.3.6.1.5.5.7.3.1',
    -2954         'clientAuth':           '1.3.6.1.5.5.7.3.2',
    -2955         'codeSigning':          '1.3.6.1.5.5.7.3.3',
    -2956         'emailProtection':      '1.3.6.1.5.5.7.3.4',
    -2957         'timeStamping':         '1.3.6.1.5.5.7.3.8',
    -2958         'ocspSigning':          '1.3.6.1.5.5.7.3.9',
    -2959 
    -2960         'ecPublicKey':          '1.2.840.10045.2.1',
    -2961         'secp256r1':            '1.2.840.10045.3.1.7',
    -2962         'secp256k1':            '1.3.132.0.10',
    -2963         'secp384r1':            '1.3.132.0.34',
    -2964 
    -2965         'pkcs5PBES2':           '1.2.840.113549.1.5.13',
    -2966         'pkcs5PBKDF2':          '1.2.840.113549.1.5.12',
    -2967 
    -2968         'des-EDE3-CBC':         '1.2.840.113549.3.7',
    -2969 
    -2970         'data':                 '1.2.840.113549.1.7.1', // CMS data
    -2971         'signed-data':          '1.2.840.113549.1.7.2', // CMS signed-data
    -2972         'enveloped-data':       '1.2.840.113549.1.7.3', // CMS enveloped-data
    -2973         'digested-data':        '1.2.840.113549.1.7.5', // CMS digested-data
    -2974         'encrypted-data':       '1.2.840.113549.1.7.6', // CMS encrypted-data
    -2975         'authenticated-data':   '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data
    -2976         'tstinfo':              '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo
    -2977         'extensionRequest':     '1.2.840.113549.1.9.14',// CSR extensionRequest
    -2978     };
    -2979 
    -2980     this.objCache = {};
    +2937 	if (params === undefined) return;
    +2938 
    +2939         if (params.rfc822 !== undefined) {
    +2940             this.type = 'rfc822';
    +2941             v = new _DERIA5String({str: params[this.type]});
    +2942         }
    +2943 
    +2944         if (params.dns !== undefined) {
    +2945             this.type = 'dns';
    +2946             v = new _DERIA5String({str: params[this.type]});
    +2947         }
    +2948 
    +2949         if (params.uri !== undefined) {
    +2950             this.type = 'uri';
    +2951             v = new _DERIA5String({str: params[this.type]});
    +2952         }
    +2953 
    +2954         if (params.dn !== undefined) {
    +2955 	    this.type = 'dn';
    +2956 	    this.explicit = true;
    +2957 	    if (typeof params.dn === "string") {
    +2958 		v = new _X500Name({str: params.dn});
    +2959 	    } else if (params.dn instanceof KJUR.asn1.x509.X500Name) {
    +2960 		v = params.dn;
    +2961 	    } else {
    +2962 		v = new _X500Name(params.dn);
    +2963 	    }
    +2964 	}
    +2965 
    +2966         if (params.ldapdn !== undefined) {
    +2967 	    this.type = 'dn';
    +2968 	    this.explicit = true;
    +2969 	    v = new _X500Name({ldapstr: params.ldapdn});
    +2970 	}
    +2971 
    +2972 	if (params.certissuer !== undefined) {
    +2973 	    this.type = 'dn';
    +2974 	    this.explicit = true;
    +2975 	    var certStr = params.certissuer;
    +2976 	    var certHex = null;
    +2977 
    +2978 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    +2979 		certHex == certStr;
    +2980             }
     2981 
    -2982     /**
    -2983      * get DERObjectIdentifier by registered OID name
    -2984      * @name name2obj
    -2985      * @memberOf KJUR.asn1.x509.OID
    -2986      * @function
    -2987      * @param {String} name OID
    -2988      * @description
    -2989      * @example
    -2990      * var asn1ObjOID = OID.name2obj('SHA1withRSA');
    -2991      */
    -2992     this.name2obj = function(name) {
    -2993         if (typeof this.objCache[name] != "undefined")
    -2994             return this.objCache[name];
    -2995         if (typeof this.name2oidList[name] == "undefined")
    -2996             throw "Name of ObjectIdentifier not defined: " + name;
    -2997         var oid = this.name2oidList[name];
    -2998         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    -2999         this.objCache[name] = obj;
    -3000         return obj;
    -3001     };
    -3002 
    -3003     /**
    -3004      * get DERObjectIdentifier by registered attribute type name such like 'C' or 'CN'<br/>
    -3005      * @name atype2obj
    -3006      * @memberOf KJUR.asn1.x509.OID
    -3007      * @function
    -3008      * @param {String} atype short attribute type name such like 'C' or 'CN'
    -3009      * @description
    -3010      * @example
    -3011      * KJUR.asn1.x509.OID.atype2obj('CN') → 2.5.4.3
    -3012      * KJUR.asn1.x509.OID.atype2obj('OU') → 2.5.4.11
    -3013      */
    -3014     this.atype2obj = function(atype) {
    -3015         if (typeof this.objCache[atype] != "undefined")
    -3016             return this.objCache[atype];
    -3017         if (typeof this.atype2oidList[atype] == "undefined")
    -3018             throw "AttributeType name undefined: " + atype;
    -3019         var oid = this.atype2oidList[atype];
    -3020         var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid});
    -3021         this.objCache[atype] = obj;
    -3022         return obj;
    -3023     };
    -3024 };
    -3025 
    -3026 /**
    -3027  * convert OID to name<br/>
    -3028  * @name oid2name
    -3029  * @memberOf KJUR.asn1.x509.OID
    -3030  * @function
    -3031  * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4)
    -3032  * @return {String} OID name if registered otherwise empty string
    -3033  * @since asn1x509 1.0.9
    -3034  * @description
    -3035  * This static method converts OID string to its name.
    -3036  * If OID is undefined then it returns empty string (i.e. '').
    -3037  * @example
    -3038  * KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1") → 'authorityInfoAccess'
    -3039  */
    -3040 KJUR.asn1.x509.OID.oid2name = function(oid) {
    -3041     var list = KJUR.asn1.x509.OID.name2oidList;
    -3042     for (var name in list) {
    -3043         if (list[name] == oid) return name;
    -3044     }
    -3045     return '';
    -3046 };
    -3047 
    -3048 /**
    -3049  * convert OID to AttributeType name<br/>
    -3050  * @name oid2atype
    -3051  * @memberOf KJUR.asn1.x509.OID
    -3052  * @function
    -3053  * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4)
    -3054  * @return {String} OID AttributeType name if registered otherwise oid
    -3055  * @since jsrsasign 6.2.2 asn1x509 1.0.18
    -3056  * @description
    -3057  * This static method converts OID string to its AttributeType name.
    -3058  * If OID is not defined in OID.atype2oidList associative array then it returns OID
    -3059  * specified as argument.
    -3060  * @example
    -3061  * KJUR.asn1.x509.OID.oid2atype("2.5.4.3") → CN
    -3062  * KJUR.asn1.x509.OID.oid2atype("1.3.6.1.4.1.311.60.2.1.3") → jurisdictionOfIncorporationC
    -3063  * KJUR.asn1.x509.OID.oid2atype("0.1.2.3.4") → 0.1.2.3.4 // unregistered OID
    -3064  */
    -3065 KJUR.asn1.x509.OID.oid2atype = function(oid) {
    -3066     var list = KJUR.asn1.x509.OID.atype2oidList;
    -3067     for (var atype in list) {
    -3068         if (list[atype] == oid) return atype;
    -3069     }
    -3070     return oid;
    -3071 };
    -3072 
    -3073 /**
    -3074  * convert OID name to OID value<br/>
    -3075  * @name name2oid
    -3076  * @memberOf KJUR.asn1.x509.OID
    -3077  * @function
    -3078  * @param {String} OID name
    -3079  * @return {String} dot noted Object Identifer string (ex. 1.2.3.4)
    -3080  * @since asn1x509 1.0.11
    -3081  * @description
    -3082  * This static method converts from OID name to OID string.
    -3083  * If OID is undefined then it returns empty string (i.e. '').
    -3084  * @example
    -3085  * KJUR.asn1.x509.OID.name2oid("authorityInfoAccess") → 1.3.6.1.5.5.7.1.1
    -3086  */
    -3087 KJUR.asn1.x509.OID.name2oid = function(name) {
    -3088     var list = KJUR.asn1.x509.OID.name2oidList;
    -3089     if (list[name] === undefined) return '';
    -3090     return list[name];
    -3091 };
    +2982 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    +2983 		certHex = _pemtohex(certStr);
    +2984 	    }
    +2985 
    +2986 	    if (certHex == null) throw "certissuer param not cert";
    +2987 	    var x = new X509();
    +2988 	    x.hex = certHex;
    +2989 	    var dnHex = x.getIssuerHex();
    +2990 	    v = new _ASN1Object();
    +2991 	    v.hTLV = dnHex;
    +2992 	}
    +2993 
    +2994 	if (params.certsubj !== undefined) {
    +2995 	    this.type = 'dn';
    +2996 	    this.explicit = true;
    +2997 	    var certStr = params.certsubj;
    +2998 	    var certHex = null;
    +2999 	    if (certStr.match(/^[0-9A-Fa-f]+$/)) {
    +3000 		certHex == certStr;
    +3001             }
    +3002 	    if (certStr.indexOf("-----BEGIN ") != -1) {
    +3003 		certHex = _pemtohex(certStr);
    +3004 	    }
    +3005 	    if (certHex == null) throw "certsubj param not cert";
    +3006 	    var x = new X509();
    +3007 	    x.hex = certHex;
    +3008 	    var dnHex = x.getSubjectHex();
    +3009 	    v = new _ASN1Object();
    +3010 	    v.hTLV = dnHex;
    +3011 	}
    +3012 
    +3013 	if (params.ip !== undefined) {
    +3014 	    this.type = 'ip';
    +3015 	    this.explicit = false;
    +3016 	    var ip = params.ip;
    +3017 	    var hIP;
    +3018 	    var malformedIPMsg = "malformed IP address";
    +3019 	    if (ip.match(/^[0-9.]+[.][0-9.]+$/)) { // ipv4
    +3020 		hIP = intarystrtohex("[" + ip.split(".").join(",") + "]");
    +3021 		if (hIP.length !== 8) throw malformedIPMsg;
    +3022 	    } else if (ip.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)) { // ipv6
    +3023 		hIP = ipv6tohex(ip);
    +3024 	    } else if (ip.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)) { // hex
    +3025 		hIP = ip;
    +3026 	    } else {
    +3027 		throw malformedIPMsg;
    +3028 	    }
    +3029 	    v = new _DEROctetString({hex: hIP});
    +3030 	}
    +3031 
    +3032         if (this.type == null)
    +3033             throw "unsupported type in params=" + params;
    +3034         this.asn1Obj = new _DERTaggedObject({'explicit': this.explicit,
    +3035                                              'tag': pTag[this.type],
    +3036                                              'obj': v});
    +3037     };
    +3038 
    +3039     this.getEncodedHex = function() {
    +3040         return this.asn1Obj.getEncodedHex();
    +3041     }
    +3042 
    +3043     if (params !== undefined) {
    +3044         this.setByParam(params);
    +3045     }
    +3046 
    +3047 };
    +3048 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object);
    +3049 
    +3050 /**
    +3051  * GeneralNames ASN.1 structure class<br/>
    +3052  * @name KJUR.asn1.x509.GeneralNames
    +3053  * @class GeneralNames ASN.1 structure class
    +3054  * @description
    +3055  * <br/>
    +3056  * <h4>EXAMPLE AND ASN.1 SYNTAX</h4>
    +3057  * @example
    +3058  * gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]);
    +3059  *
    +3060  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
    +3061  */
    +3062 KJUR.asn1.x509.GeneralNames = function(paramsArray) {
    +3063     KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);
    +3064     var asn1Array = null,
    +3065 	_KJUR = KJUR,
    +3066 	_KJUR_asn1 = _KJUR.asn1;
    +3067 
    +3068     /**
    +3069      * set a array of {@link KJUR.asn1.x509.GeneralName} parameters<br/>
    +3070      * @name setByParamArray
    +3071      * @memberOf KJUR.asn1.x509.GeneralNames#
    +3072      * @function
    +3073      * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames}
    +3074      * @description
    +3075      * <br/>
    +3076      * <h4>EXAMPLES</h4>
    +3077      * @example
    +3078      * gns = new KJUR.asn1.x509.GeneralNames();
    +3079      * gns.setByParamArray([{uri: 'http://aaa.com/'}, {uri: 'http://bbb.com/'}]);
    +3080      */
    +3081     this.setByParamArray = function(paramsArray) {
    +3082         for (var i = 0; i < paramsArray.length; i++) {
    +3083             var o = new _KJUR_asn1.x509.GeneralName(paramsArray[i]);
    +3084             this.asn1Array.push(o);
    +3085         }
    +3086     };
    +3087 
    +3088     this.getEncodedHex = function() {
    +3089         var o = new _KJUR_asn1.DERSequence({'array': this.asn1Array});
    +3090         return o.getEncodedHex();
    +3091     };
     3092 
    -3093 /**
    -3094  * X.509 certificate and CRL utilities class<br/>
    -3095  * @name KJUR.asn1.x509.X509Util
    -3096  * @class X.509 certificate and CRL utilities class
    -3097  */
    -3098 KJUR.asn1.x509.X509Util = {};
    +3093     this.asn1Array = new Array();
    +3094     if (typeof paramsArray != "undefined") {
    +3095         this.setByParamArray(paramsArray);
    +3096     }
    +3097 };
    +3098 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object);
     3099 
     3100 /**
    -3101  * issue a certificate in PEM format
    -3102  * @name newCertPEM
    -3103  * @memberOf KJUR.asn1.x509.X509Util
    -3104  * @function
    -3105  * @param {Array} param parameter to issue a certificate
    -3106  * @since asn1x509 1.0.6
    -3107  * @description
    -3108  * This method can issue a certificate by a simple
    -3109  * JSON object.
    -3110  * Signature value will be provided by signing with
    -3111  * private key using 'cakey' parameter or
    -3112  * hexa decimal signature value by 'sighex' parameter.
    -3113  * <br/>
    -3114  * NOTE: Algorithm parameter of AlgorithmIdentifier will
    -3115  * be set automatically by default. 
    -3116  * (see {@link KJUR.asn1.x509.AlgorithmIdentifier})
    -3117  * from jsrsasign 7.1.1 asn1x509 1.0.20.
    -3118  * <br/>
    -3119  * NOTE2: 
    -3120  * RSA-PSS algorithm has been supported from jsrsasign 8.0.21.
    -3121  * As for RSA-PSS signature algorithm names and signing parameters 
    -3122  * such as MGF function and salt length, please see
    -3123  * {@link KJUR.asn1.x509.AlgorithmIdentifier} class.
    -3124  *
    -3125  * @example
    -3126  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -3127  *   serial: {int: 4},
    -3128  *   sigalg: {name: 'SHA1withECDSA'},
    -3129  *   issuer: {str: '/C=US/O=a'},
    -3130  *   notbefore: {'str': '130504235959Z'},
    -3131  *   notafter: {'str': '140504235959Z'},
    -3132  *   subject: {str: '/C=US/O=b'},
    -3133  *   sbjpubkey: pubKeyObj,
    -3134  *   ext: [
    -3135  *     {basicConstraints: {cA: true, critical: true}},
    -3136  *     {keyUsage: {bin: '11'}},
    -3137  *   ],
    -3138  *   cakey: prvKeyObj
    -3139  * });
    -3140  * // -- or --
    -3141  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -3142  *   serial: {int: 4},
    -3143  *   sigalg: {name: 'SHA1withECDSA'},
    -3144  *   issuer: {str: '/C=US/O=a'},
    -3145  *   notbefore: {'str': '130504235959Z'},
    -3146  *   notafter: {'str': '140504235959Z'},
    -3147  *   subject: {str: '/C=US/O=b'},
    -3148  *   sbjpubkey: pubKeyPEM,
    -3149  *   ext: [
    -3150  *     {basicConstraints: {cA: true, critical: true}},
    -3151  *     {keyUsage: {bin: '11'}},
    -3152  *   ],
    -3153  *   cakey: [prvkey, pass]}
    -3154  * );
    -3155  * // -- or --
    -3156  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -3157  *   serial: {int: 1},
    -3158  *   sigalg: {name: 'SHA1withRSA'},
    -3159  *   issuer: {str: '/C=US/O=T1'},
    -3160  *   notbefore: {'str': '130504235959Z'},
    -3161  *   notafter: {'str': '140504235959Z'},
    -3162  *   subject: {str: '/C=US/O=T1'},
    -3163  *   sbjpubkey: pubKeyObj,
    -3164  *   sighex: '0102030405..'
    -3165  * });
    -3166  * // for the issuer and subject field, another
    -3167  * // representation is also available
    -3168  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({
    -3169  *   serial: {int: 1},
    -3170  *   sigalg: {name: 'SHA256withRSA'},
    -3171  *   issuer: {C: "US", O: "T1"},
    -3172  *   notbefore: {'str': '130504235959Z'},
    -3173  *   notafter: {'str': '140504235959Z'},
    -3174  *   subject: {C: "US", O: "T1", CN: "http://example.com/"},
    -3175  *   sbjpubkey: pubKeyObj,
    -3176  *   sighex: '0102030405..'
    -3177  * });
    -3178  */
    -3179 KJUR.asn1.x509.X509Util.newCertPEM = function(param) {
    -3180     var _KJUR_asn1_x509 = KJUR.asn1.x509,
    -3181 	_TBSCertificate = _KJUR_asn1_x509.TBSCertificate,
    -3182 	_Certificate = _KJUR_asn1_x509.Certificate;
    -3183     var o = new _TBSCertificate();
    -3184 
    -3185     if (param.serial !== undefined)
    -3186         o.setSerialNumberByParam(param.serial);
    -3187     else
    -3188         throw "serial number undefined.";
    -3189 
    -3190     if (typeof param.sigalg.name === 'string')
    -3191         o.setSignatureAlgByParam(param.sigalg);
    -3192     else
    -3193         throw "unproper signature algorithm name";
    -3194 
    -3195     if (param.issuer !== undefined)
    -3196         o.setIssuerByParam(param.issuer);
    -3197     else
    -3198         throw "issuer name undefined.";
    -3199 
    -3200     if (param.notbefore !== undefined)
    -3201         o.setNotBeforeByParam(param.notbefore);
    -3202     else
    -3203         throw "notbefore undefined.";
    -3204 
    -3205     if (param.notafter !== undefined)
    -3206         o.setNotAfterByParam(param.notafter);
    -3207     else
    -3208         throw "notafter undefined.";
    -3209 
    -3210     if (param.subject !== undefined)
    -3211         o.setSubjectByParam(param.subject);
    -3212     else
    -3213         throw "subject name undefined.";
    -3214 
    -3215     if (param.sbjpubkey !== undefined)
    -3216         o.setSubjectPublicKeyByGetKey(param.sbjpubkey);
    -3217     else
    -3218         throw "subject public key undefined.";
    -3219 
    -3220     if (param.ext !== undefined && param.ext.length !== undefined) {
    -3221         for (var i = 0; i < param.ext.length; i++) {
    -3222             for (key in param.ext[i]) {
    -3223                 o.appendExtensionByName(key, param.ext[i][key]);
    -3224             }
    -3225         }
    -3226     }
    -3227 
    -3228     // set signature
    -3229     if (param.cakey === undefined && param.sighex === undefined)
    -3230         throw "param cakey and sighex undefined.";
    -3231 
    -3232     var caKey = null;
    -3233     var cert = null;
    -3234 
    -3235     if (param.cakey) {
    -3236 	if (param.cakey.isPrivate === true) {
    -3237 	    caKey = param.cakey;
    -3238 	} else {
    -3239             caKey = KEYUTIL.getKey.apply(null, param.cakey);
    -3240 	}
    -3241         cert = new _Certificate({'tbscertobj': o, 'prvkeyobj': caKey});
    -3242         cert.sign();
    -3243     }
    -3244 
    -3245     if (param.sighex) {
    -3246         cert = new _Certificate({'tbscertobj': o});
    -3247         cert.setSignatureHex(param.sighex);
    -3248     }
    -3249 
    -3250     return cert.getPEMString();
    -3251 };
    -3252 
    -3253 
    \ No newline at end of file +3101 * DistributionPointName ASN.1 structure class<br/> +3102 * @name KJUR.asn1.x509.DistributionPointName +3103 * @class DistributionPointName ASN.1 structure class +3104 * @description +3105 * <pre> +3106 * DistributionPoint ::= SEQUENCE { +3107 * distributionPoint [0] DistributionPointName OPTIONAL, +3108 * reasons [1] ReasonFlags OPTIONAL, +3109 * cRLIssuer [2] GeneralNames OPTIONAL } +3110 * +3111 * DistributionPointName ::= CHOICE { +3112 * fullName [0] GeneralNames, +3113 * nameRelativeToCRLIssuer [1] RelativeDistinguishedName } +3114 * +3115 * ReasonFlags ::= BIT STRING { +3116 * unused (0), +3117 * keyCompromise (1), +3118 * cACompromise (2), +3119 * affiliationChanged (3), +3120 * superseded (4), +3121 * cessationOfOperation (5), +3122 * certificateHold (6), +3123 * privilegeWithdrawn (7), +3124 * aACompromise (8) } +3125 * </pre> +3126 * @example +3127 */
    +3128 KJUR.asn1.x509.DistributionPointName = function(gnOrRdn) { +3129 KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this); +3130 var asn1Obj = null, +3131 type = null, +3132 tag = null, +3133 asn1V = null, +3134 _KJUR = KJUR, +3135 _KJUR_asn1 = _KJUR.asn1, +3136 _DERTaggedObject = _KJUR_asn1.DERTaggedObject; +3137 +3138 this.getEncodedHex = function() { +3139 if (this.type != "full") +3140 throw "currently type shall be 'full': " + this.type; +3141 this.asn1Obj = new _DERTaggedObject({'explicit': false, +3142 'tag': this.tag, +3143 'obj': this.asn1V}); +3144 this.hTLV = this.asn1Obj.getEncodedHex(); +3145 return this.hTLV; +3146 }; +3147 +3148 if (gnOrRdn !== undefined) { +3149 if (_KJUR_asn1.x509.GeneralNames.prototype.isPrototypeOf(gnOrRdn)) { +3150 this.type = "full"; +3151 this.tag = "a0"; +3152 this.asn1V = gnOrRdn; +3153 } else { +3154 throw "This class supports GeneralNames only as argument"; +3155 } +3156 } +3157 }; +3158 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object); +3159 +3160 /** +3161 * DistributionPoint ASN.1 structure class<br/> +3162 * @name KJUR.asn1.x509.DistributionPoint +3163 * @class DistributionPoint ASN.1 structure class +3164 * @description +3165 * <pre> +3166 * DistributionPoint ::= SEQUENCE { +3167 * distributionPoint [0] DistributionPointName OPTIONAL, +3168 * reasons [1] ReasonFlags OPTIONAL, +3169 * cRLIssuer [2] GeneralNames OPTIONAL } +3170 * +3171 * DistributionPointName ::= CHOICE { +3172 * fullName [0] GeneralNames, +3173 * nameRelativeToCRLIssuer [1] RelativeDistinguishedName } +3174 * +3175 * ReasonFlags ::= BIT STRING { +3176 * unused (0), +3177 * keyCompromise (1), +3178 * cACompromise (2), +3179 * affiliationChanged (3), +3180 * superseded (4), +3181 * cessationOfOperation (5), +3182 * certificateHold (6), +3183 * privilegeWithdrawn (7), +3184 * aACompromise (8) } +3185 * </pre> +3186 * @example +3187 */ +3188 KJUR.asn1.x509.DistributionPoint = function(params) { +3189 KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this); +3190 var asn1DP = null, +3191 _KJUR = KJUR, +3192 _KJUR_asn1 = _KJUR.asn1; +3193 +3194 this.getEncodedHex = function() { +3195 var seq = new _KJUR_asn1.DERSequence(); +3196 if (this.asn1DP != null) { +3197 var o1 = new _KJUR_asn1.DERTaggedObject({'explicit': true, +3198 'tag': 'a0', +3199 'obj': this.asn1DP}); +3200 seq.appendASN1Object(o1); +3201 } +3202 this.hTLV = seq.getEncodedHex(); +3203 return this.hTLV; +3204 }; +3205 +3206 if (params !== undefined) { +3207 if (params.dpobj !== undefined) { +3208 this.asn1DP = params.dpobj; +3209 } +3210 } +3211 }; +3212 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object); +3213 +3214 /** +3215 * static object for OID +3216 * @name KJUR.asn1.x509.OID +3217 * @class static object for OID +3218 * @property {Assoc Array} atype2oidList for short attribute type name and oid (ex. 'C' and '2.5.4.6') +3219 * @property {Assoc Array} name2oidList for oid name and oid (ex. 'keyUsage' and '2.5.29.15') +3220 * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object +3221 * @description +3222 * This class defines OID name and values. +3223 * AttributeType names registered in OID.atype2oidList are following: +3224 * <table style="border-width: thin; border-style: solid; witdh: 100%"> +3225 * <tr><th>short</th><th>long</th><th>OID</th></tr> +3226 * <tr><td>CN</td>commonName<td></td><td>2.5.4.3</td></tr> +3227 * <tr><td>L</td><td>localityName</td><td>2.5.4.7</td></tr> +3228 * <tr><td>ST</td><td>stateOrProvinceName</td><td>2.5.4.8</td></tr> +3229 * <tr><td>O</td><td>organizationName</td><td>2.5.4.10</td></tr> +3230 * <tr><td>OU</td><td>organizationalUnitName</td><td>2.5.4.11</td></tr> +3231 * <tr><td>C</td><td></td>countryName<td>2.5.4.6</td></tr> +3232 * <tr><td>STREET</td>streetAddress<td></td><td>2.5.4.6</td></tr> +3233 * <tr><td>DC</td><td>domainComponent</td><td>0.9.2342.19200300.100.1.25</td></tr> +3234 * <tr><td>UID</td><td>userId</td><td>0.9.2342.19200300.100.1.1</td></tr> +3235 * <tr><td>SN</td><td>surname</td><td>2.5.4.4</td></tr> +3236 * <tr><td>DN</td><td>distinguishedName</td><td>2.5.4.49</td></tr> +3237 * <tr><td>E</td><td>emailAddress</td><td>1.2.840.113549.1.9.1</td></tr> +3238 * <tr><td></td><td>businessCategory</td><td>2.5.4.15</td></tr> +3239 * <tr><td></td><td>postalCode</td><td>2.5.4.17</td></tr> +3240 * <tr><td></td><td>jurisdictionOfIncorporationL</td><td>1.3.6.1.4.1.311.60.2.1.1</td></tr> +3241 * <tr><td></td><td>jurisdictionOfIncorporationSP</td><td>1.3.6.1.4.1.311.60.2.1.2</td></tr> +3242 * <tr><td></td><td>jurisdictionOfIncorporationC</td><td>1.3.6.1.4.1.311.60.2.1.3</td></tr> +3243 * </table> +3244 * +3245 * @example +3246 */ +3247 KJUR.asn1.x509.OID = new function(params) { +3248 this.atype2oidList = { +3249 // RFC 4514 AttributeType name string (MUST recognized) +3250 'CN': '2.5.4.3', +3251 'L': '2.5.4.7', +3252 'ST': '2.5.4.8', +3253 'O': '2.5.4.10', +3254 'OU': '2.5.4.11', +3255 'C': '2.5.4.6', +3256 'STREET': '2.5.4.9', +3257 'DC': '0.9.2342.19200300.100.1.25', +3258 'UID': '0.9.2342.19200300.100.1.1', +3259 // other AttributeType name string +3260 // http://blog.livedoor.jp/k_urushima/archives/656114.html +3261 'SN': '2.5.4.4', // surname +3262 'T': '2.5.4.12', // title +3263 'DN': '2.5.4.49', // distinguishedName +3264 'E': '1.2.840.113549.1.9.1', // emailAddress in MS.NET or Bouncy +3265 // other AttributeType name string (no short name) +3266 'description': '2.5.4.13', +3267 'businessCategory': '2.5.4.15', +3268 'postalCode': '2.5.4.17', +3269 'serialNumber': '2.5.4.5', +3270 'uniqueIdentifier': '2.5.4.45', +3271 'organizationIdentifier': '2.5.4.97', +3272 'jurisdictionOfIncorporationL': '1.3.6.1.4.1.311.60.2.1.1', +3273 'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2', +3274 'jurisdictionOfIncorporationC': '1.3.6.1.4.1.311.60.2.1.3' +3275 }; +3276 this.name2oidList = { +3277 'sha1': '1.3.14.3.2.26', +3278 'sha256': '2.16.840.1.101.3.4.2.1', +3279 'sha384': '2.16.840.1.101.3.4.2.2', +3280 'sha512': '2.16.840.1.101.3.4.2.3', +3281 'sha224': '2.16.840.1.101.3.4.2.4', +3282 'md5': '1.2.840.113549.2.5', +3283 'md2': '1.3.14.7.2.2.1', +3284 'ripemd160': '1.3.36.3.2.1', +3285 +3286 'MD2withRSA': '1.2.840.113549.1.1.2', +3287 'MD4withRSA': '1.2.840.113549.1.1.3', +3288 'MD5withRSA': '1.2.840.113549.1.1.4', +3289 'SHA1withRSA': '1.2.840.113549.1.1.5', +3290 'SHA224withRSA': '1.2.840.113549.1.1.14', +3291 'SHA256withRSA': '1.2.840.113549.1.1.11', +3292 'SHA384withRSA': '1.2.840.113549.1.1.12', +3293 'SHA512withRSA': '1.2.840.113549.1.1.13', +3294 +3295 'SHA1withECDSA': '1.2.840.10045.4.1', +3296 'SHA224withECDSA': '1.2.840.10045.4.3.1', +3297 'SHA256withECDSA': '1.2.840.10045.4.3.2', +3298 'SHA384withECDSA': '1.2.840.10045.4.3.3', +3299 'SHA512withECDSA': '1.2.840.10045.4.3.4', +3300 +3301 'dsa': '1.2.840.10040.4.1', +3302 'SHA1withDSA': '1.2.840.10040.4.3', +3303 'SHA224withDSA': '2.16.840.1.101.3.4.3.1', +3304 'SHA256withDSA': '2.16.840.1.101.3.4.3.2', +3305 +3306 'rsaEncryption': '1.2.840.113549.1.1.1', +3307 +3308 // X.500 AttributeType defined in RFC 4514 +3309 'commonName': '2.5.4.3', +3310 'countryName': '2.5.4.6', +3311 'localityName': '2.5.4.7', +3312 'stateOrProvinceName': '2.5.4.8', +3313 'streetAddress': '2.5.4.9', +3314 'organizationName': '2.5.4.10', +3315 'organizationalUnitName': '2.5.4.11', +3316 'domainComponent': '0.9.2342.19200300.100.1.25', +3317 'userId': '0.9.2342.19200300.100.1.1', +3318 // other AttributeType name string +3319 'surname': '2.5.4.4', +3320 'title': '2.5.4.12', +3321 'distinguishedName': '2.5.4.49', +3322 'emailAddress': '1.2.840.113549.1.9.1', +3323 // other AttributeType name string (no short name) +3324 'description': '2.5.4.13', +3325 'businessCategory': '2.5.4.15', +3326 'postalCode': '2.5.4.17', +3327 'uniqueIdentifier': '2.5.4.45', +3328 'organizationIdentifier': '2.5.4.97', +3329 'jurisdictionOfIncorporationL': '1.3.6.1.4.1.311.60.2.1.1', +3330 'jurisdictionOfIncorporationSP':'1.3.6.1.4.1.311.60.2.1.2', +3331 'jurisdictionOfIncorporationC': '1.3.6.1.4.1.311.60.2.1.3', +3332 +3333 'subjectKeyIdentifier': '2.5.29.14', +3334 'keyUsage': '2.5.29.15', +3335 'subjectAltName': '2.5.29.17', +3336 'issuerAltName': '2.5.29.18', +3337 'basicConstraints': '2.5.29.19', +3338 'nameConstraints': '2.5.29.30', +3339 'cRLDistributionPoints':'2.5.29.31', +3340 'certificatePolicies': '2.5.29.32', +3341 'authorityKeyIdentifier':'2.5.29.35', +3342 'policyConstraints': '2.5.29.36', +3343 'extKeyUsage': '2.5.29.37', +3344 'authorityInfoAccess': '1.3.6.1.5.5.7.1.1', +3345 'ocsp': '1.3.6.1.5.5.7.48.1', +3346 'caIssuers': '1.3.6.1.5.5.7.48.2', +3347 +3348 'anyExtendedKeyUsage': '2.5.29.37.0', +3349 'serverAuth': '1.3.6.1.5.5.7.3.1', +3350 'clientAuth': '1.3.6.1.5.5.7.3.2', +3351 'codeSigning': '1.3.6.1.5.5.7.3.3', +3352 'emailProtection': '1.3.6.1.5.5.7.3.4', +3353 'timeStamping': '1.3.6.1.5.5.7.3.8', +3354 'ocspSigning': '1.3.6.1.5.5.7.3.9', +3355 +3356 'ecPublicKey': '1.2.840.10045.2.1', +3357 'secp256r1': '1.2.840.10045.3.1.7', +3358 'secp256k1': '1.3.132.0.10', +3359 'secp384r1': '1.3.132.0.34', +3360 +3361 'pkcs5PBES2': '1.2.840.113549.1.5.13', +3362 'pkcs5PBKDF2': '1.2.840.113549.1.5.12', +3363 +3364 'des-EDE3-CBC': '1.2.840.113549.3.7', +3365 +3366 'data': '1.2.840.113549.1.7.1', // CMS data +3367 'signed-data': '1.2.840.113549.1.7.2', // CMS signed-data +3368 'enveloped-data': '1.2.840.113549.1.7.3', // CMS enveloped-data +3369 'digested-data': '1.2.840.113549.1.7.5', // CMS digested-data +3370 'encrypted-data': '1.2.840.113549.1.7.6', // CMS encrypted-data +3371 'authenticated-data': '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data +3372 'tstinfo': '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo +3373 'extensionRequest': '1.2.840.113549.1.9.14',// CSR extensionRequest +3374 }; +3375 +3376 this.objCache = {}; +3377 +3378 /** +3379 * get DERObjectIdentifier by registered OID name +3380 * @name name2obj +3381 * @memberOf KJUR.asn1.x509.OID +3382 * @function +3383 * @param {String} name OID +3384 * @description +3385 * @example +3386 * var asn1ObjOID = OID.name2obj('SHA1withRSA'); +3387 */ +3388 this.name2obj = function(name) { +3389 if (typeof this.objCache[name] != "undefined") +3390 return this.objCache[name]; +3391 if (typeof this.name2oidList[name] == "undefined") +3392 throw "Name of ObjectIdentifier not defined: " + name; +3393 var oid = this.name2oidList[name]; +3394 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); +3395 this.objCache[name] = obj; +3396 return obj; +3397 }; +3398 +3399 /** +3400 * get DERObjectIdentifier by registered attribute type name such like 'C' or 'CN'<br/> +3401 * @name atype2obj +3402 * @memberOf KJUR.asn1.x509.OID +3403 * @function +3404 * @param {String} atype short attribute type name such like 'C' or 'CN' +3405 * @description +3406 * @example +3407 * KJUR.asn1.x509.OID.atype2obj('CN') → 2.5.4.3 +3408 * KJUR.asn1.x509.OID.atype2obj('OU') → 2.5.4.11 +3409 */ +3410 this.atype2obj = function(atype) { +3411 if (typeof this.objCache[atype] != "undefined") +3412 return this.objCache[atype]; +3413 if (typeof this.atype2oidList[atype] == "undefined") +3414 throw "AttributeType name undefined: " + atype; +3415 var oid = this.atype2oidList[atype]; +3416 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); +3417 this.objCache[atype] = obj; +3418 return obj; +3419 }; +3420 }; +3421 +3422 /** +3423 * convert OID to name<br/> +3424 * @name oid2name +3425 * @memberOf KJUR.asn1.x509.OID +3426 * @function +3427 * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4) +3428 * @return {String} OID name if registered otherwise empty string +3429 * @since asn1x509 1.0.9 +3430 * @description +3431 * This static method converts OID string to its name. +3432 * If OID is undefined then it returns empty string (i.e. ''). +3433 * @example +3434 * KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1") → 'authorityInfoAccess' +3435 */ +3436 KJUR.asn1.x509.OID.oid2name = function(oid) { +3437 var list = KJUR.asn1.x509.OID.name2oidList; +3438 for (var name in list) { +3439 if (list[name] == oid) return name; +3440 } +3441 return ''; +3442 }; +3443 +3444 /** +3445 * convert OID to AttributeType name<br/> +3446 * @name oid2atype +3447 * @memberOf KJUR.asn1.x509.OID +3448 * @function +3449 * @param {String} oid dot noted Object Identifer string (ex. 1.2.3.4) +3450 * @return {String} OID AttributeType name if registered otherwise oid +3451 * @since jsrsasign 6.2.2 asn1x509 1.0.18 +3452 * @description +3453 * This static method converts OID string to its AttributeType name. +3454 * If OID is not defined in OID.atype2oidList associative array then it returns OID +3455 * specified as argument. +3456 * @example +3457 * KJUR.asn1.x509.OID.oid2atype("2.5.4.3") → CN +3458 * KJUR.asn1.x509.OID.oid2atype("1.3.6.1.4.1.311.60.2.1.3") → jurisdictionOfIncorporationC +3459 * KJUR.asn1.x509.OID.oid2atype("0.1.2.3.4") → 0.1.2.3.4 // unregistered OID +3460 */ +3461 KJUR.asn1.x509.OID.oid2atype = function(oid) { +3462 var list = KJUR.asn1.x509.OID.atype2oidList; +3463 for (var atype in list) { +3464 if (list[atype] == oid) return atype; +3465 } +3466 return oid; +3467 }; +3468 +3469 /** +3470 * convert OID name to OID value<br/> +3471 * @name name2oid +3472 * @memberOf KJUR.asn1.x509.OID +3473 * @function +3474 * @param {String} OID name +3475 * @return {String} dot noted Object Identifer string (ex. 1.2.3.4) +3476 * @since asn1x509 1.0.11 +3477 * @description +3478 * This static method converts from OID name to OID string. +3479 * If OID is undefined then it returns empty string (i.e. ''). +3480 * @example +3481 * KJUR.asn1.x509.OID.name2oid("authorityInfoAccess") → 1.3.6.1.5.5.7.1.1 +3482 */ +3483 KJUR.asn1.x509.OID.name2oid = function(name) { +3484 var list = KJUR.asn1.x509.OID.name2oidList; +3485 if (list[name] === undefined) return ''; +3486 return list[name]; +3487 }; +3488 +3489 /** +3490 * X.509 certificate and CRL utilities class<br/> +3491 * @name KJUR.asn1.x509.X509Util +3492 * @class X.509 certificate and CRL utilities class +3493 */ +3494 KJUR.asn1.x509.X509Util = {}; +3495 +3496 /** +3497 * issue a certificate in PEM format +3498 * @name newCertPEM +3499 * @memberOf KJUR.asn1.x509.X509Util +3500 * @function +3501 * @param {Array} param parameter to issue a certificate +3502 * @since asn1x509 1.0.6 +3503 * @description +3504 * This method can issue a certificate by a simple +3505 * JSON object. +3506 * Signature value will be provided by signing with +3507 * private key using 'cakey' parameter or +3508 * hexa decimal signature value by 'sighex' parameter. +3509 * <br/> +3510 * NOTE: Algorithm parameter of AlgorithmIdentifier will +3511 * be set automatically by default. +3512 * (see {@link KJUR.asn1.x509.AlgorithmIdentifier}) +3513 * from jsrsasign 7.1.1 asn1x509 1.0.20. +3514 * <br/> +3515 * NOTE2: +3516 * RSA-PSS algorithm has been supported from jsrsasign 8.0.21. +3517 * As for RSA-PSS signature algorithm names and signing parameters +3518 * such as MGF function and salt length, please see +3519 * {@link KJUR.asn1.x509.AlgorithmIdentifier} class. +3520 * +3521 * @example +3522 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +3523 * serial: {int: 4}, +3524 * sigalg: {name: 'SHA1withECDSA'}, +3525 * issuer: {str: '/C=US/O=a'}, +3526 * notbefore: {'str': '130504235959Z'}, +3527 * notafter: {'str': '140504235959Z'}, +3528 * subject: {str: '/C=US/O=b'}, +3529 * sbjpubkey: pubKeyObj, +3530 * ext: [ +3531 * {basicConstraints: {cA: true, critical: true}}, +3532 * {keyUsage: {bin: '11'}}, +3533 * ], +3534 * cakey: prvKeyObj +3535 * }); +3536 * // -- or -- +3537 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +3538 * serial: {int: 4}, +3539 * sigalg: {name: 'SHA1withECDSA'}, +3540 * issuer: {str: '/C=US/O=a'}, +3541 * notbefore: {'str': '130504235959Z'}, +3542 * notafter: {'str': '140504235959Z'}, +3543 * subject: {str: '/C=US/O=b'}, +3544 * sbjpubkey: pubKeyPEM, +3545 * ext: [ +3546 * {basicConstraints: {cA: true, critical: true}}, +3547 * {keyUsage: {bin: '11'}}, +3548 * ], +3549 * cakey: [prvkey, pass]} +3550 * ); +3551 * // -- or -- +3552 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +3553 * serial: {int: 1}, +3554 * sigalg: {name: 'SHA1withRSA'}, +3555 * issuer: {str: '/C=US/O=T1'}, +3556 * notbefore: {'str': '130504235959Z'}, +3557 * notafter: {'str': '140504235959Z'}, +3558 * subject: {str: '/C=US/O=T1'}, +3559 * sbjpubkey: pubKeyObj, +3560 * sighex: '0102030405..' +3561 * }); +3562 * // for the issuer and subject field, another +3563 * // representation is also available +3564 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ +3565 * serial: {int: 1}, +3566 * sigalg: {name: 'SHA256withRSA'}, +3567 * issuer: {C: "US", O: "T1"}, +3568 * notbefore: {'str': '130504235959Z'}, +3569 * notafter: {'str': '140504235959Z'}, +3570 * subject: {C: "US", O: "T1", CN: "http://example.com/"}, +3571 * sbjpubkey: pubKeyObj, +3572 * sighex: '0102030405..' +3573 * }); +3574 */ +3575 KJUR.asn1.x509.X509Util.newCertPEM = function(param) { +3576 var _KJUR_asn1_x509 = KJUR.asn1.x509, +3577 _TBSCertificate = _KJUR_asn1_x509.TBSCertificate, +3578 _Certificate = _KJUR_asn1_x509.Certificate; +3579 var o = new _TBSCertificate(); +3580 +3581 if (param.serial !== undefined) +3582 o.setSerialNumberByParam(param.serial); +3583 else +3584 throw "serial number undefined."; +3585 +3586 if (typeof param.sigalg.name === 'string') +3587 o.setSignatureAlgByParam(param.sigalg); +3588 else +3589 throw "unproper signature algorithm name"; +3590 +3591 if (param.issuer !== undefined) +3592 o.setIssuerByParam(param.issuer); +3593 else +3594 throw "issuer name undefined."; +3595 +3596 if (param.notbefore !== undefined) +3597 o.setNotBeforeByParam(param.notbefore); +3598 else +3599 throw "notbefore undefined."; +3600 +3601 if (param.notafter !== undefined) +3602 o.setNotAfterByParam(param.notafter); +3603 else +3604 throw "notafter undefined."; +3605 +3606 if (param.subject !== undefined) +3607 o.setSubjectByParam(param.subject); +3608 else +3609 throw "subject name undefined."; +3610 +3611 if (param.sbjpubkey !== undefined) +3612 o.setSubjectPublicKeyByGetKey(param.sbjpubkey); +3613 else +3614 throw "subject public key undefined."; +3615 +3616 if (param.ext !== undefined && param.ext.length !== undefined) { +3617 for (var i = 0; i < param.ext.length; i++) { +3618 for (key in param.ext[i]) { +3619 o.appendExtensionByName(key, param.ext[i][key]); +3620 } +3621 } +3622 } +3623 +3624 // set signature +3625 if (param.cakey === undefined && param.sighex === undefined) +3626 throw "param cakey and sighex undefined."; +3627 +3628 var caKey = null; +3629 var cert = null; +3630 +3631 if (param.cakey) { +3632 if (param.cakey.isPrivate === true) { +3633 caKey = param.cakey; +3634 } else { +3635 caKey = KEYUTIL.getKey.apply(null, param.cakey); +3636 } +3637 cert = new _Certificate({'tbscertobj': o, 'prvkeyobj': caKey}); +3638 cert.sign(); +3639 } +3640 +3641 if (param.sighex) { +3642 cert = new _Certificate({'tbscertobj': o}); +3643 cert.setSignatureHex(param.sighex); +3644 } +3645 +3646 return cert.getPEMString(); +3647 }; +3648 +3649
    \ No newline at end of file diff --git a/bower.json b/bower.json index 5f353b51..83f06499 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "kjur-jsrsasign", - "version": "8.0.22", + "version": "8.0.23", "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 c80185ee..feb9ccc9 100644 --- a/jsrsasign-all-min.js +++ b/jsrsasign-all-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign(all) 8.0.22 (2020-08-05) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign(all) 8.0.23 (2020-08-06) (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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{throw"unsupported extension name: "+e}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var b=KJUR,a=b.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence();for(var e=0;e0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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;e15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{if(g=="certificatepolicies"){var d=new f.CertificatePolicies(c);b.push(d)}else{throw new Error("unsupported extension name: "+e)}}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CertificatePolicies=function(f){KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this,f);var c=KJUR,b=c.asn1,e=b.x509,a=b.DERSequence,d=e.PolicyInformation;this.params=null;this.getExtnValueHex=function(){var j=[];for(var h=0;h0){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){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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){r=new b({obj:this.dUnsignedAttrs,tag:"a1",explicit:false})}var q=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,o,this.dSigAlg,this.dSig,];if(r!=null){q.push(r)}var p=new h.DERSequence({array:q});this.hTLV=p.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.EncapsulatedContentInfo=function(g){var c=KJUR,b=c.asn1,e=b.DERTaggedObject,a=b.DERSequence,h=b.DERObjectIdentifier,d=b.DEROctetString,f=b.cms;f.EncapsulatedContentInfo.superclass.constructor.call(this);this.dEContentType=new h({name:"data"});this.dEContent=null;this.isDetached=false;this.eContentValueHex=null;this.setContentType=function(i){if(i.match(/^[0-2][.][0-9.]+$/)){this.dEContentType=new h({oid:i})}else{this.dEContentType=new h({name:i})}};this.setContentValue=function(i){if(i!==undefined){if(typeof i.hex=="string"){this.eContentValueHex=i.hex}else{if(typeof i.str=="string"){this.eContentValueHex=utf8tohex(i.str)}}}};this.setContentValueHex=function(i){this.eContentValueHex=i};this.setContentValueStr=function(i){this.eContentValueHex=utf8tohex(i)};this.getEncodedHex=function(){if(typeof this.eContentValueHex!="string"){throw"eContentValue not yet set"}var k=new d({hex:this.eContentValueHex});this.dEContent=new e({obj:k,tag:"a0",explicit:true});var i=[this.dEContentType];if(!this.isDetached){i.push(this.dEContent)}var j=new a({array:i});this.hTLV=j.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.ContentInfo=function(f){var c=KJUR,b=c.asn1,d=b.DERTaggedObject,a=b.DERSequence,e=b.x509;KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this);this.dContentType=null;this.dContent=null;this.setContentType=function(g){if(typeof g=="string"){this.dContentType=e.OID.name2obj(g)}};this.getEncodedHex=function(){var h=new d({obj:this.dContent,tag:"a0",explicit:true});var g=new a({array:[this.dContentType,h]});this.hTLV=g.getEncodedHex();return this.hTLV};if(f!==undefined){if(f.type){this.setContentType(f.type)}if(f.obj&&f.obj instanceof b.ASN1Object){this.dContent=f.obj}}};YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.SignedData=function(e){var a=KJUR,h=a.asn1,j=h.ASN1Object,g=h.DERInteger,m=h.DERSet,f=h.DERSequence,b=h.DERTaggedObject,l=h.cms,i=l.EncapsulatedContentInfo,d=l.SignerInfo,n=l.ContentInfo,c=h.x509,k=c.AlgorithmIdentifier;KJUR.asn1.cms.SignedData.superclass.constructor.call(this);this.dCMSVersion=new g({"int":1});this.dDigestAlgs=null;this.digestAlgNameList=[];this.dEncapContentInfo=new i();this.dCerts=null;this.certificateList=[];this.crlList=[];this.signerInfoList=[new d()];this.addCertificatesByPEM=function(p){var q=pemtohex(p);var r=new j();r.hTLV=q;this.certificateList.push(r)};this.getEncodedHex=function(){if(typeof this.hTLV=="string"){return this.hTLV}if(this.dDigestAlgs==null){var u=[];for(var t=0;t0){var v=new m({array:this.certificateList});this.dCerts=new b({obj:v,tag:"a0",explicit:false})}}if(this.dCerts!=null){p.push(this.dCerts)}var r=new m({array:this.signerInfoList});p.push(r);var q=new f({array:p});this.hTLV=q.getEncodedHex();return this.hTLV};this.getContentInfo=function(){this.getEncodedHex();var o=new n({type:"signed-data",obj:this});return o};this.getContentInfoEncodedHex=function(){var o=this.getContentInfo();var p=o.getEncodedHex();return p};this.getPEM=function(){return hextopem(this.getContentInfoEncodedHex(),"CMS")}};YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object);KJUR.asn1.cms.CMSUtil=new function(){};KJUR.asn1.cms.CMSUtil.newSignedData=function(d){var b=KJUR,j=b.asn1,q=j.cms,f=q.SignerInfo,n=q.SignedData,o=q.SigningTime,a=q.SigningCertificate,p=q.SigningCertificateV2,c=j.cades,e=c.SignaturePolicyIdentifier;var m=new n();m.dEncapContentInfo.setContentValue(d.content);if(typeof d.detached=="boolean"){m.dEncapContentInfo.isDetached=d.detached}if(typeof d.certs=="object"){for(var h=0;h=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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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;e15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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;e=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{throw"unsupported extension name: "+e}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var b=KJUR,a=b.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence();for(var e=0;e0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{if(g=="certificatepolicies"){var d=new f.CertificatePolicies(c);b.push(d)}else{throw new Error("unsupported extension name: "+e)}}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CertificatePolicies=function(f){KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this,f);var c=KJUR,b=c.asn1,e=b.x509,a=b.DERSequence,d=e.PolicyInformation;this.params=null;this.getExtnValueHex=function(){var j=[];for(var h=0;h0){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){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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=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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{throw"unsupported extension name: "+e}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var b=KJUR,a=b.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence();for(var e=0;e0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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;e15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{if(g=="certificatepolicies"){var d=new f.CertificatePolicies(c);b.push(d)}else{throw new Error("unsupported extension name: "+e)}}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CertificatePolicies=function(f){KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this,f);var c=KJUR,b=c.asn1,e=b.x509,a=b.DERSequence,d=e.PolicyInformation;this.params=null;this.getExtnValueHex=function(){var j=[];for(var h=0;h0){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){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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){r=new b({obj:this.dUnsignedAttrs,tag:"a1",explicit:false})}var q=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,o,this.dSigAlg,this.dSig,];if(r!=null){q.push(r)}var p=new h.DERSequence({array:q});this.hTLV=p.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.EncapsulatedContentInfo=function(g){var c=KJUR,b=c.asn1,e=b.DERTaggedObject,a=b.DERSequence,h=b.DERObjectIdentifier,d=b.DEROctetString,f=b.cms;f.EncapsulatedContentInfo.superclass.constructor.call(this);this.dEContentType=new h({name:"data"});this.dEContent=null;this.isDetached=false;this.eContentValueHex=null;this.setContentType=function(i){if(i.match(/^[0-2][.][0-9.]+$/)){this.dEContentType=new h({oid:i})}else{this.dEContentType=new h({name:i})}};this.setContentValue=function(i){if(i!==undefined){if(typeof i.hex=="string"){this.eContentValueHex=i.hex}else{if(typeof i.str=="string"){this.eContentValueHex=utf8tohex(i.str)}}}};this.setContentValueHex=function(i){this.eContentValueHex=i};this.setContentValueStr=function(i){this.eContentValueHex=utf8tohex(i)};this.getEncodedHex=function(){if(typeof this.eContentValueHex!="string"){throw"eContentValue not yet set"}var k=new d({hex:this.eContentValueHex});this.dEContent=new e({obj:k,tag:"a0",explicit:true});var i=[this.dEContentType];if(!this.isDetached){i.push(this.dEContent)}var j=new a({array:i});this.hTLV=j.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.ContentInfo=function(f){var c=KJUR,b=c.asn1,d=b.DERTaggedObject,a=b.DERSequence,e=b.x509;KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this);this.dContentType=null;this.dContent=null;this.setContentType=function(g){if(typeof g=="string"){this.dContentType=e.OID.name2obj(g)}};this.getEncodedHex=function(){var h=new d({obj:this.dContent,tag:"a0",explicit:true});var g=new a({array:[this.dContentType,h]});this.hTLV=g.getEncodedHex();return this.hTLV};if(f!==undefined){if(f.type){this.setContentType(f.type)}if(f.obj&&f.obj instanceof b.ASN1Object){this.dContent=f.obj}}};YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.SignedData=function(e){var a=KJUR,h=a.asn1,j=h.ASN1Object,g=h.DERInteger,m=h.DERSet,f=h.DERSequence,b=h.DERTaggedObject,l=h.cms,i=l.EncapsulatedContentInfo,d=l.SignerInfo,n=l.ContentInfo,c=h.x509,k=c.AlgorithmIdentifier;KJUR.asn1.cms.SignedData.superclass.constructor.call(this);this.dCMSVersion=new g({"int":1});this.dDigestAlgs=null;this.digestAlgNameList=[];this.dEncapContentInfo=new i();this.dCerts=null;this.certificateList=[];this.crlList=[];this.signerInfoList=[new d()];this.addCertificatesByPEM=function(p){var q=pemtohex(p);var r=new j();r.hTLV=q;this.certificateList.push(r)};this.getEncodedHex=function(){if(typeof this.hTLV=="string"){return this.hTLV}if(this.dDigestAlgs==null){var u=[];for(var t=0;t0){var v=new m({array:this.certificateList});this.dCerts=new b({obj:v,tag:"a0",explicit:false})}}if(this.dCerts!=null){p.push(this.dCerts)}var r=new m({array:this.signerInfoList});p.push(r);var q=new f({array:p});this.hTLV=q.getEncodedHex();return this.hTLV};this.getContentInfo=function(){this.getEncodedHex();var o=new n({type:"signed-data",obj:this});return o};this.getContentInfoEncodedHex=function(){var o=this.getContentInfo();var p=o.getEncodedHex();return p};this.getPEM=function(){return hextopem(this.getContentInfoEncodedHex(),"CMS")}};YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object);KJUR.asn1.cms.CMSUtil=new function(){};KJUR.asn1.cms.CMSUtil.newSignedData=function(d){var b=KJUR,j=b.asn1,q=j.cms,f=q.SignerInfo,n=q.SignedData,o=q.SigningTime,a=q.SigningCertificate,p=q.SigningCertificateV2,c=j.cades,e=c.SignaturePolicyIdentifier;var m=new n();m.dEncapContentInfo.setContentValue(d.content);if(typeof d.detached=="boolean"){m.dEncapContentInfo.isDetached=d.detached}if(typeof d.certs=="object"){for(var h=0;h=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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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;e15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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 = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="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(e.substr(l,2)=="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(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{throw"unsupported extension name: "+e}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var b=KJUR,a=b.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence();for(var e=0;e0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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;e15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};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""}};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||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};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){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);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=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=="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){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{if(g=="certificatepolicies"){var d=new f.CertificatePolicies(c);b.push(d)}else{throw new Error("unsupported extension name: "+e)}}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.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){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CertificatePolicies=function(f){KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this,f);var c=KJUR,b=c.asn1,e=b.x509,a=b.DERSequence,d=e.PolicyInformation;this.params=null;this.getExtnValueHex=function(){var j=[];for(var h=0;h0){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){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;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(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;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(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};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){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){r=new b({obj:this.dUnsignedAttrs,tag:"a1",explicit:false})}var q=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,o,this.dSigAlg,this.dSig,];if(r!=null){q.push(r)}var p=new h.DERSequence({array:q});this.hTLV=p.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.EncapsulatedContentInfo=function(g){var c=KJUR,b=c.asn1,e=b.DERTaggedObject,a=b.DERSequence,h=b.DERObjectIdentifier,d=b.DEROctetString,f=b.cms;f.EncapsulatedContentInfo.superclass.constructor.call(this);this.dEContentType=new h({name:"data"});this.dEContent=null;this.isDetached=false;this.eContentValueHex=null;this.setContentType=function(i){if(i.match(/^[0-2][.][0-9.]+$/)){this.dEContentType=new h({oid:i})}else{this.dEContentType=new h({name:i})}};this.setContentValue=function(i){if(i!==undefined){if(typeof i.hex=="string"){this.eContentValueHex=i.hex}else{if(typeof i.str=="string"){this.eContentValueHex=utf8tohex(i.str)}}}};this.setContentValueHex=function(i){this.eContentValueHex=i};this.setContentValueStr=function(i){this.eContentValueHex=utf8tohex(i)};this.getEncodedHex=function(){if(typeof this.eContentValueHex!="string"){throw"eContentValue not yet set"}var k=new d({hex:this.eContentValueHex});this.dEContent=new e({obj:k,tag:"a0",explicit:true});var i=[this.dEContentType];if(!this.isDetached){i.push(this.dEContent)}var j=new a({array:i});this.hTLV=j.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.ContentInfo=function(f){var c=KJUR,b=c.asn1,d=b.DERTaggedObject,a=b.DERSequence,e=b.x509;KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this);this.dContentType=null;this.dContent=null;this.setContentType=function(g){if(typeof g=="string"){this.dContentType=e.OID.name2obj(g)}};this.getEncodedHex=function(){var h=new d({obj:this.dContent,tag:"a0",explicit:true});var g=new a({array:[this.dContentType,h]});this.hTLV=g.getEncodedHex();return this.hTLV};if(f!==undefined){if(f.type){this.setContentType(f.type)}if(f.obj&&f.obj instanceof b.ASN1Object){this.dContent=f.obj}}};YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.SignedData=function(e){var a=KJUR,h=a.asn1,j=h.ASN1Object,g=h.DERInteger,m=h.DERSet,f=h.DERSequence,b=h.DERTaggedObject,l=h.cms,i=l.EncapsulatedContentInfo,d=l.SignerInfo,n=l.ContentInfo,c=h.x509,k=c.AlgorithmIdentifier;KJUR.asn1.cms.SignedData.superclass.constructor.call(this);this.dCMSVersion=new g({"int":1});this.dDigestAlgs=null;this.digestAlgNameList=[];this.dEncapContentInfo=new i();this.dCerts=null;this.certificateList=[];this.crlList=[];this.signerInfoList=[new d()];this.addCertificatesByPEM=function(p){var q=pemtohex(p);var r=new j();r.hTLV=q;this.certificateList.push(r)};this.getEncodedHex=function(){if(typeof this.hTLV=="string"){return this.hTLV}if(this.dDigestAlgs==null){var u=[];for(var t=0;t0){var v=new m({array:this.certificateList});this.dCerts=new b({obj:v,tag:"a0",explicit:false})}}if(this.dCerts!=null){p.push(this.dCerts)}var r=new m({array:this.signerInfoList});p.push(r);var q=new f({array:p});this.hTLV=q.getEncodedHex();return this.hTLV};this.getContentInfo=function(){this.getEncodedHex();var o=new n({type:"signed-data",obj:this});return o};this.getContentInfoEncodedHex=function(){var o=this.getContentInfo();var p=o.getEncodedHex();return p};this.getPEM=function(){return hextopem(this.getContentInfoEncodedHex(),"CMS")}};YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object);KJUR.asn1.cms.CMSUtil=new function(){};KJUR.asn1.cms.CMSUtil.newSignedData=function(d){var b=KJUR,j=b.asn1,q=j.cms,f=q.SignerInfo,n=q.SignedData,o=q.SigningTime,a=q.SigningCertificate,p=q.SigningCertificateV2,c=j.cades,e=c.SignaturePolicyIdentifier;var m=new n();m.dEncapContentInfo.setContentValue(d.content);if(typeof d.detached=="boolean"){m.dEncapContentInfo.isDetached=d.detached}if(typeof d.certs=="object"){for(var h=0;hMIT License */ @@ -62,6 +62,8 @@ if (typeof KJUR == "undefined" || !KJUR) KJUR = {}; *
  • 0x16 {@link KJUR.asn1.DERIA5String}
  • *
  • 0x17 {@link KJUR.asn1.DERUTCTime}
  • *
  • 0x18 {@link KJUR.asn1.DERGeneralizedTime}
  • + *
  • 0x1a {@link KJUR.asn1.DERVisibleString}
  • + *
  • 0x1e {@link KJUR.asn1.DERBMPString}
  • *
  • 0x30 {@link KJUR.asn1.DERSequence}
  • *
  • 0x31 {@link KJUR.asn1.DERSet}
  • * @@ -184,6 +186,8 @@ KJUR.asn1.ASN1Util = new function() { *
  • 'ia5str' - DERIA5String
  • *
  • 'utctime' - DERUTCTime
  • *
  • 'gentime' - DERGeneralizedTime
  • + *
  • 'visstr' - DERVisibleString
  • + *
  • 'bmpstr' - DERBMPString
  • *
  • 'seq' - DERSequence
  • *
  • 'set' - DERSet
  • *
  • 'tag' - DERTaggedObject
  • @@ -220,6 +224,8 @@ KJUR.asn1.ASN1Util = new function() { _DERIA5String = _KJUR_asn1.DERIA5String, _DERUTCTime = _KJUR_asn1.DERUTCTime, _DERGeneralizedTime = _KJUR_asn1.DERGeneralizedTime, + _DERVisibleString = _KJUR_asn1.DERVisibleString, + _DERBMPString = _KJUR_asn1.DERBMPString, _DERSequence = _KJUR_asn1.DERSequence, _DERSet = _KJUR_asn1.DERSet, _DERTaggedObject = _KJUR_asn1.DERTaggedObject, @@ -230,8 +236,8 @@ KJUR.asn1.ASN1Util = new function() { throw "key of param shall be only one."; var key = keys[0]; - if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + key + ":") == -1) - throw "undefined key: " + key; + if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":" + key + ":") == -1) + throw new Error("undefined key: " + key); if (key == "bool") return new _DERBoolean(param[key]); if (key == "int") return new _DERInteger(param[key]); @@ -247,6 +253,8 @@ KJUR.asn1.ASN1Util = new function() { if (key == "ia5str") return new _DERIA5String(param[key]); if (key == "utctime") return new _DERUTCTime(param[key]); if (key == "gentime") return new _DERGeneralizedTime(param[key]); + if (key == "visstr") return new _DERVisibleString(param[key]); + if (key == "bmpstr") return new _DERBMPString(param[key]); if (key == "seq") { var paramList = param[key]; @@ -1369,6 +1377,40 @@ KJUR.asn1.DERIA5String = function(params) { }; YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString); +// ******************************************************************** +/** + * class for ASN.1 DER VisibleString + * @name KJUR.asn1.DERVisibleString + * @class class for ASN.1 DER VisibleString + * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) + * @extends KJUR.asn1.DERAbstractString + * @since jsrsasign 8.0.23 asn1 1.0.15 + * @description + * @see KJUR.asn1.DERAbstractString - superclass + */ +KJUR.asn1.DERVisibleString = function(params) { + KJUR.asn1.DERIA5String.superclass.constructor.call(this, params); + this.hT = "1a"; +}; +YAHOO.lang.extend(KJUR.asn1.DERVisibleString, KJUR.asn1.DERAbstractString); + +// ******************************************************************** +/** + * class for ASN.1 DER BMPString + * @name KJUR.asn1.DERBMPString + * @class class for ASN.1 DER BMPString + * @param {Array} params associative array of parameters (ex. {'str': 'aaa'}) + * @extends KJUR.asn1.DERAbstractString + * @since jsrsasign 8.0.23 asn1 1.0.15 + * @description + * @see KJUR.asn1.DERAbstractString - superclass + */ +KJUR.asn1.DERBMPString = function(params) { + KJUR.asn1.DERBMPString.superclass.constructor.call(this, params); + this.hT = "1e"; +}; +YAHOO.lang.extend(KJUR.asn1.DERBMPString, KJUR.asn1.DERAbstractString); + // ******************************************************************** /** * class for ASN.1 DER UTCTime diff --git a/src/asn1hex-1.1.js b/src/asn1hex-1.1.js index 90f19771..bd9e013d 100644 --- a/src/asn1hex-1.1.js +++ b/src/asn1hex-1.1.js @@ -715,7 +715,9 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { if (indent === undefined) indent = ""; var skipLongHex = flags.ommit_long_octet; - if (hex.substr(idx, 2) == "01") { + var tag = hex.substr(idx, 2); + + if (tag == "01") { var v = _getV(hex, idx); if (v == "00") { return indent + "BOOLEAN FALSE\n"; @@ -723,11 +725,11 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { return indent + "BOOLEAN TRUE\n"; } } - if (hex.substr(idx, 2) == "02") { + if (tag == "02") { var v = _getV(hex, idx); return indent + "INTEGER " + _skipLongHex(v, skipLongHex) + "\n"; } - if (hex.substr(idx, 2) == "03") { + if (tag == "03") { var v = _getV(hex, idx); if (_ASN1HEX.isASN1HEX(v.substr(2))) { var s = indent + "BITSTRING, encapsulates\n"; @@ -737,7 +739,7 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { return indent + "BITSTRING " + _skipLongHex(v, skipLongHex) + "\n"; } } - if (hex.substr(idx, 2) == "04") { + if (tag == "04") { var v = _getV(hex, idx); if (_ASN1HEX.isASN1HEX(v)) { var s = indent + "OCTETSTRING, encapsulates\n"; @@ -747,10 +749,10 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { return indent + "OCTETSTRING " + _skipLongHex(v, skipLongHex) + "\n"; } } - if (hex.substr(idx, 2) == "05") { + if (tag == "05") { return indent + "NULL\n"; } - if (hex.substr(idx, 2) == "06") { + if (tag == "06") { var hV = _getV(hex, idx); var oidDot = KJUR.asn1.ASN1Util.oidHexToInt(hV); var oidName = KJUR.asn1.x509.OID.oid2name(oidDot); @@ -761,25 +763,31 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { return indent + "ObjectIdentifier (" + oidSpc + ")\n"; } } - if (hex.substr(idx, 2) == "0c") { + if (tag == "0c") { return indent + "UTF8String '" + hextoutf8(_getV(hex, idx)) + "'\n"; } - if (hex.substr(idx, 2) == "13") { + if (tag == "13") { return indent + "PrintableString '" + hextoutf8(_getV(hex, idx)) + "'\n"; } - if (hex.substr(idx, 2) == "14") { + if (tag == "14") { return indent + "TeletexString '" + hextoutf8(_getV(hex, idx)) + "'\n"; } - if (hex.substr(idx, 2) == "16") { + if (tag == "16") { return indent + "IA5String '" + hextoutf8(_getV(hex, idx)) + "'\n"; } - if (hex.substr(idx, 2) == "17") { + if (tag == "17") { return indent + "UTCTime " + hextoutf8(_getV(hex, idx)) + "\n"; } - if (hex.substr(idx, 2) == "18") { + if (tag == "18") { return indent + "GeneralizedTime " + hextoutf8(_getV(hex, idx)) + "\n"; } - if (hex.substr(idx, 2) == "30") { + if (tag == "1a") { + return indent + "VisualString '" + hextoutf8(_getV(hex, idx)) + "'\n"; + } + if (tag == "1e") { + return indent + "BMPString '" + hextoutf8(_getV(hex, idx)) + "'\n"; + } + if (tag == "30") { if (hex.substr(idx, 4) == "3000") { return indent + "SEQUENCE {}\n"; } @@ -803,7 +811,7 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { } return s; } - if (hex.substr(idx, 2) == "31") { + if (tag == "31") { var s = indent + "SET\n"; var aIdx = _getChildIdx(hex, idx); for (var i = 0; i < aIdx.length; i++) { @@ -811,7 +819,7 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { } return s; } - var tag = parseInt(hex.substr(idx, 2), 16); + var tag = parseInt(tag, 16); if ((tag & 128) != 0) { // context specific var tagNumber = tag & 31; if ((tag & 32) != 0) { // structured tag @@ -835,7 +843,7 @@ ASN1HEX.dump = function(hexOrObj, flags, idx, indent) { return s; } } - return indent + "UNKNOWN(" + hex.substr(idx, 2) + ") " + + return indent + "UNKNOWN(" + tag + ") " + _getV(hex, idx) + "\n"; }; diff --git a/src/asn1x509-1.0.js b/src/asn1x509-1.0.js index d3707b4f..e1417c17 100644 --- a/src/asn1x509-1.0.js +++ b/src/asn1x509-1.0.js @@ -1,4 +1,4 @@ -/* asn1x509-1.1.11.js (c) 2013-2020 Kenji Urushima | kjur.github.com/jsrsasign/license +/* asn1x509-1.1.12.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 8.0.21 asn1x509 1.1.11 (2020-Jul-28) + * @version jsrsasign 8.0.23 asn1x509 1.1.12 (2020-Apr-06) * @since jsrsasign 2.1 * @license MIT License */ @@ -70,16 +70,20 @@ if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {}; *
  • {@link KJUR.asn1.x509.BasicConstraints}
  • *
  • {@link KJUR.asn1.x509.KeyUsage}
  • *
  • {@link KJUR.asn1.x509.CRLDistributionPoints}
  • + *
  • {@link KJUR.asn1.x509.CertificatePolicies}
  • *
  • {@link KJUR.asn1.x509.ExtKeyUsage}
  • *
  • {@link KJUR.asn1.x509.AuthorityKeyIdentifier}
  • *
  • {@link KJUR.asn1.x509.SubjectKeyIdentifier}
  • *
  • {@link KJUR.asn1.x509.AuthorityInfoAccess}
  • *
  • {@link KJUR.asn1.x509.SubjectAltName}
  • *
  • {@link KJUR.asn1.x509.IssuerAltName}
  • + *
  • {@link KJUR.asn1.x509.CertificatePolicies}
  • * * NOTE1: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
    - * NOTE2: SubjectAltName and IssuerAltName extension were supported since + * NOTE2: SubjectAltName and IssuerAltName supported since * jsrsasign 6.2.3 asn1x509 1.0.19.
    + * NOTE3: CeritifcatePolicies supported supported since + * jsrsasign 8.0.23 asn1x509 1.1.12
    * @name KJUR.asn1.x509 * @namespace */ @@ -416,12 +420,14 @@ KJUR.asn1.x509.TBSCertificate = function(params) { *
  • BasicConstraints - {@link KJUR.asn1.x509.BasicConstraints}
  • *
  • KeyUsage - {@link KJUR.asn1.x509.KeyUsage}
  • *
  • CRLDistributionPoints - {@link KJUR.asn1.x509.CRLDistributionPoints}
  • + *
  • CertificatePolicies - {@link KJUR.asn1.x509.CertificatePolicies}
  • *
  • ExtKeyUsage - {@link KJUR.asn1.x509.ExtKeyUsage}
  • *
  • AuthorityKeyIdentifier - {@link KJUR.asn1.x509.AuthorityKeyIdentifier}
  • *
  • SubjectKeyIdentifier - {@link KJUR.asn1.x509.SubjectKeyIdentifier}
  • *
  • AuthorityInfoAccess - {@link KJUR.asn1.x509.AuthorityInfoAccess}
  • *
  • SubjectAltName - {@link KJUR.asn1.x509.SubjectAltName}
  • *
  • IssuerAltName - {@link KJUR.asn1.x509.IssuerAltName}
  • + *
  • CertificatePolicies - {@link KJUR.asn1.x509.CertificatePolicies}
  • * * @example * var o = new KJUR.asn1.x509.TBSCertificate(); @@ -576,8 +582,11 @@ KJUR.asn1.x509.Extension.appendByNameToArray = function(name, extParams, a) { } else if (_lowname == "issueraltname") { var extObj = new _KJUR_asn1_x509.IssuerAltName(extParams); a.push(extObj); + } else if (_lowname == "certificatepolicies") { + var extObj = new _KJUR_asn1_x509.CertificatePolicies(extParams); + a.push(extObj); } else { - throw "unsupported extension name: " + name; + throw new Error("unsupported extension name: " + name); } }; @@ -743,6 +752,393 @@ KJUR.asn1.x509.CRLDistributionPoints = function(params) { }; YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints, KJUR.asn1.x509.Extension); +/** + * CertificatePolicies ASN.1 structure class + * @name KJUR.asn1.x509.CertificatePolicies + * @class CertificatePolicies ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.x509.Extension + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * CertificatePolicies extension defined in RFC 5280 4.2.1.4. + *
    + * id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 }
    + * CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
    + * 
    + * Its constructor can have following parameters: + *
      + *
    • array - array of {@link KJUR.asn1.x509.PolicyInformation} parameter
    • + *
    • critical - boolean: critical flag + *
    + * @example + * e1 = new KJUR.asn1.x509.CertificatePolicies({ + * array: [ + * { policyoid: "1.2.3.4.5", + * array: [ + * { cps: "https://example.com/repository" }, + * { unotice: { + * noticeref: { // CA SHOULD NOT use this by RFC + * org: {type: "ia5", str: "Sample Org"}, + * noticenum: [{int: 5}, {hex: "01af"}] + * }, + * exptext: {type: "ia5", str: "Sample Policy"} + * }} + * ] + * } + * ], + * critical: true + * }); + */ +KJUR.asn1.x509.CertificatePolicies = function(params) { + KJUR.asn1.x509.CertificatePolicies.superclass.constructor.call(this, params); + var _KJUR = KJUR, + _KJUR_asn1 = _KJUR.asn1, + _KJUR_asn1_x509 = _KJUR_asn1.x509, + _DERSequence = _KJUR_asn1.DERSequence, + _PolicyInformation = _KJUR_asn1_x509.PolicyInformation; + + this.params = null; + + this.getExtnValueHex = function() { + var aPI = []; + for (var i = 0; i < this.params.array.length; i++) { + aPI.push(new _PolicyInformation(this.params.array[i])); + } + var seq = new _DERSequence({array: aPI}); + this.asn1ExtnValue = seq; + return this.asn1ExtnValue.getEncodedHex(); + }; + + this.oid = "2.5.29.32"; + if (params !== undefined) { + this.params = params; + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.CertificatePolicies, KJUR.asn1.x509.Extension); + +/** + * PolicyInformation ASN.1 structure class + * @name KJUR.asn1.x509.PolicyInformation + * @class PolicyInformation ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * PolicyInformation defined in RFC 5280 4.2.1.4. + *
    + * PolicyInformation ::= SEQUENCE {
    + *      policyIdentifier   CertPolicyId,
    + *      policyQualifiers   SEQUENCE SIZE (1..MAX) OF
    + *                         PolicyQualifierInfo OPTIONAL }
    + * CertPolicyId ::= OBJECT IDENTIFIER
    + * Its constructor can have following parameters:
    + * 
      + *
    • {String}policyoid - policy OID (ex. "1.2.3.4.5")
    • + *
    • {Object}array - array of {@link KJUR.asn1.x509.PolicyQualifierInfo} + * parameters (OPTIONAL)
    • + *
    + * @example + * new KJUR.asn1.x509.PolicyInformation({ + * policyoid: "1.2.3.4.5", + * array: [ + * { cps: "https://example.com/repository" }, + * { unotice: { + * noticeref: { // CA SHOULD NOT use this by RFC + * org: {type: "ia5", str: "Sample Org"}, + * noticenum: [{int: 5}, {hex: "01af"}] + * }, + * exptext: {type: "ia5", str: "Sample Policy"} + * }} + * ] + * }) + */ +KJUR.asn1.x509.PolicyInformation = function(params) { + KJUR.asn1.x509.PolicyInformation.superclass.constructor.call(this, + params); + var _KJUR_asn1 = KJUR.asn1, + _DERSequence = _KJUR_asn1.DERSequence, + _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier, + _PolicyQualifierInfo = _KJUR_asn1.x509.PolicyQualifierInfo; + + this.params = null; + + this.getEncodedHex = function() { + if (this.params.policyoid === undefined && + this.params.array === undefined) + throw new Error("parameter oid and array missing"); + + // policy oid + var a = [new _DERObjectIdentifier({oid: this.params.policyoid})]; + + // array of ASN1Object of PolicyQualifierInfo + if (this.params.array !== undefined) { + var aPQI = []; + for (var i = 0; i < this.params.array.length; i++) { + aPQI.push(new _PolicyQualifierInfo(this.params.array[i])); + } + if (aPQI.length > 0) { + a.push(new _DERSequence({array: aPQI})); + } + } + + var seq = new _DERSequence({array: a}); + return seq.getEncodedHex(); + }; + + if (params !== undefined) { + this.params = params; + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.PolicyInformation, KJUR.asn1.ASN1Object); + +/** + * PolicyQualifierInfo ASN.1 structure class + * @name KJUR.asn1.x509.PolicyQualifierInfo + * @class PolicyQualifierInfo ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * PolicyQualifierInfo defined in RFC 5280 4.2.1.4. + *
    + * PolicyQualifierInfo ::= SEQUENCE {
    + *      policyQualifierId  PolicyQualifierId,
    + *      qualifier          ANY DEFINED BY policyQualifierId }
    + * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
    + * CPSuri ::= IA5String
    + * 
    + * Its constructor can have one of following two parameters: + *
      + *
    • {String}cps - URI string for CPS
    • + *
    • {Object}unotice - {@link KJUR.asn1.x509.UserNotice} parameter
    • + *
    + * @example + * new PolicyQualifierInfo({ + * cps: "https://example.com/repository/cps" + * }) + * + * new PolicyQualifierInfo({ + * unotice: { + * noticeref: { // CA SHOULD NOT use this by RFC + * org: {type: "bmp", str: "Sample Org"}, + * noticenum: [{int: 3}, {hex: "01af"}] + * }, + * exptext: {type: "ia5", str: "Sample Policy"} + * } + * }) + */ +KJUR.asn1.x509.PolicyQualifierInfo = function(params) { + KJUR.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this, + params); + var _KJUR_asn1 = KJUR.asn1, + _DERSequence = _KJUR_asn1.DERSequence, + _DERIA5String = _KJUR_asn1.DERIA5String, + _DERObjectIdentifier = _KJUR_asn1.DERObjectIdentifier, + _UserNotice = _KJUR_asn1.x509.UserNotice; + + this.params = null; + + this.getEncodedHex = function() { + if (this.params.cps !== undefined) { + var seq = new _DERSequence({array: [ + new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.1'}), + new _DERIA5String({str: this.params.cps}) + ]}); + return seq.getEncodedHex(); + } + if (this.params.unotice != undefined) { + var seq = new _DERSequence({array: [ + new _DERObjectIdentifier({oid: '1.3.6.1.5.5.7.2.2'}), + new _UserNotice(this.params.unotice) + ]}); + return seq.getEncodedHex(); + } + }; + + if (params !== undefined) { + this.params = params; + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.PolicyQualifierInfo, KJUR.asn1.ASN1Object); + + +/** + * UserNotice ASN.1 structure class + * @name KJUR.asn1.x509.UserNotice + * @class UserNotice ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * UserNotice defined in RFC 5280 4.2.1.4. + *
    + * UserNotice ::= SEQUENCE {
    + *      noticeRef        NoticeReference OPTIONAL,
    + *      explicitText     DisplayText OPTIONAL }
    + * 
    + * Its constructor can have following two parameters: + *
      + *
    • {Object}noticeref - {@link KJUR.asn1.x509.NoticeReference} parameter. + * This SHALL NOT be set for conforming CA by RFC 5280. (OPTIONAL)
    • + *
    • {Object}exptext - explicitText value + * by {@link KJUR.asn1.x509.DisplayText} parameter (OPTIONAL)
    • + *
    + * @example + * new UserNotice({ + * noticeref: { + * org: {type: "bmp", str: "Sample Org"}, + * noticenum: [{int: 3}, {hex: "01af"}] + * }, + * exptext: {type: "ia5", str: "Sample Policy"} + * }) + */ +KJUR.asn1.x509.UserNotice = function(params) { + KJUR.asn1.x509.UserNotice.superclass.constructor.call(this, params); + var _DERSequence = KJUR.asn1.DERSequence, + _DERInteger = KJUR.asn1.DERInteger, + _DisplayText = KJUR.asn1.x509.DisplayText, + _NoticeReference = KJUR.asn1.x509.NoticeReference; + + this.params = null; + + this.getEncodedHex = function() { + var a = []; + if (this.params.noticeref !== undefined) { + a.push(new _NoticeReference(this.params.noticeref)); + } + if (this.params.exptext !== undefined) { + a.push(new _DisplayText(this.params.exptext)); + } + var seq = new _DERSequence({array: a}); + return seq.getEncodedHex(); + }; + + if (params !== undefined) { + this.params = params; + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.UserNotice, KJUR.asn1.ASN1Object); + +/** + * NoticeReference ASN.1 structure class + * @name KJUR.asn1.x509.NoticeReference + * @class NoticeReference ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * NoticeReference defined in RFC 5280 4.2.1.4. + *
    + * NoticeReference ::= SEQUENCE {
    + *      organization     DisplayText,
    + *      noticeNumbers    SEQUENCE OF INTEGER }
    + * 
    + * Its constructor can have following two parameters: + *
      + *
    • {Object}org - organization by {@link KJUR.asn1.x509.DisplayText} + * parameter.
    • + *
    • {Object}noticenum - noticeNumbers value by an array of + * {@link KJUR.asn1.DERInteger} parameter
    • + *
    + * @example + * new NoticeReference({ + * org: {type: "bmp", str: "Sample Org"}, + * noticenum: [{int: 3}, {hex: "01af"}] + * }) + */ +KJUR.asn1.x509.NoticeReference = function(params) { + KJUR.asn1.x509.NoticeReference.superclass.constructor.call(this, params); + var _DERSequence = KJUR.asn1.DERSequence, + _DERInteger = KJUR.asn1.DERInteger, + _DisplayText = KJUR.asn1.x509.DisplayText; + + this.params = null; + + this.getEncodedHex = function() { + var a = []; + if (this.params.org !== undefined) { + a.push(new _DisplayText(this.params.org)); + } + if (this.params.noticenum !== undefined) { + var aNoticeNum = []; + var aNumParam = this.params.noticenum; + for (var i = 0; i < aNumParam.length; i++) { + aNoticeNum.push(new _DERInteger(aNumParam[i])); + } + a.push(new _DERSequence({array: aNoticeNum})); + } + if (a.length == 0) throw new Error("parameter is empty"); + var seq = new _DERSequence({array: a}); + return seq.getEncodedHex(); + } + + if (params !== undefined) { + this.params = params; + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.NoticeReference, KJUR.asn1.ASN1Object); + +/** + * DisplayText ASN.1 structure class + * @name KJUR.asn1.x509.DisplayText + * @class DisplayText ASN.1 structure class + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.DERAbstractString + * @since jsrsasign 8.0.23 asn1x509 1.1.12 + * @description + * This class represents + * + * DisplayText defined in RFC 5280 4.2.1.4. + *
    + * -- from RFC 5280 Appendix A
    + * DisplayText ::= CHOICE {
    + *      ia5String        IA5String      (SIZE (1..200)),
    + *      visibleString    VisibleString  (SIZE (1..200)),
    + *      bmpString        BMPString      (SIZE (1..200)),
    + *      utf8String       UTF8String     (SIZE (1..200)) }
    + * 
    + * {@link KJUR.asn1.DERAbstractString} parameters and methods + * can be used. + * Its constructor can also have following parameter: + *
      + *
    • {String} type - DirectoryString type of DisplayText. + * "ia5" for IA5String, "vis" for VisibleString, + * "bmp" for BMPString and "utf8" for UTF8String. + * Default is "utf8". (OPTIONAL)
    • + *
    + * @example + * new DisplayText({type: "bmp", str: "Sample Org"}) + * new DisplayText({type: "ia5", str: "Sample Org"}) + * new DisplayText({str: "Sample Org"}) + */ +KJUR.asn1.x509.DisplayText = function(params) { + KJUR.asn1.x509.DisplayText.superclass.constructor.call(this, params); + + this.hT = "0c"; // DEFAULT "utf8" + + if (params !== undefined) { + if (params.type === "ia5") { + this.hT = "16"; + } else if (params.type === "vis") { + this.hT = "1a"; + } else if (params.type === "bmp") { + this.hT = "1e"; + } + } +}; +YAHOO.lang.extend(KJUR.asn1.x509.DisplayText, KJUR.asn1.DERAbstractString); + +// ===================================================================== /** * KeyUsage ASN.1 structure class * @name KJUR.asn1.x509.ExtKeyUsage diff --git a/test/qunit-do-asn1-newobj.html b/test/qunit-do-asn1-newobj.html index 2676b759..82f516f2 100755 --- a/test/qunit-do-asn1-newobj.html +++ b/test/qunit-do-asn1-newobj.html @@ -43,105 +43,75 @@ equal(KJUR.asn1.ASN1Util.newObject({'bitstr': '001a2b'}).getEncodedHex(), "0303001a2b", "test1"); }); -test("octstr test 1a2b", function() { - equal(KJUR.asn1.ASN1Util.newObject({'octstr': {'hex': '1a2b'}}).getEncodedHex(), "04021a2b", "test1"); +test("octstr test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'octstr': {'hex': '1a2b'}}).getEncodedHex(), "04021a2b", "test1 04021a2b"); + equal(KJUR.asn1.ASN1Util.newObject({'octstr': 'abc'}).getEncodedHex(), "0403616263", "test1 abc=0403616263"); }); -test("octstr test abc", function() { - equal(KJUR.asn1.ASN1Util.newObject({'octstr': 'abc'}).getEncodedHex(), "0403616263", "test1"); -}); - - test("null test", function() { equal(KJUR.asn1.ASN1Util.newObject({'null': {}}).getEncodedHex(), "0500", "test1"); }); -test("oid test 2.5.4.5", function() { - equal(KJUR.asn1.ASN1Util.newObject({'oid': {'oid': '2.5.4.5'}}).getEncodedHex(), "0603550405", "test1"); -}); - -test("oid test 2.5.4.5", function() { - equal(KJUR.asn1.ASN1Util.newObject({'oid': '2.5.4.5'}).getEncodedHex(), "0603550405", "test1"); -}); - -test("oid test keyUsage", function() { - equal(KJUR.asn1.ASN1Util.newObject({'oid': 'keyUsage'}).getEncodedHex(), "0603551d0f", "test1"); -}); - -test("oid test countryName", function() { - equal(KJUR.asn1.ASN1Util.newObject({'oid': 'countryName'}).getEncodedHex(), "0603550406", "test1"); +test("oid test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'oid': {'oid': '2.5.4.5'}}).getEncodedHex(), "0603550405", "{oid: {oid: 2.5.4.5}}"); + equal(KJUR.asn1.ASN1Util.newObject({'oid': '2.5.4.5'}).getEncodedHex(), "0603550405", "{oid: 2.5.4.5}"); + equal(KJUR.asn1.ASN1Util.newObject({'oid': 'keyUsage'}).getEncodedHex(), "0603551d0f", "keyUsage"); + equal(KJUR.asn1.ASN1Util.newObject({'oid': 'countryName'}).getEncodedHex(), "0603550406", "countryName"); }); -test("utf8str test aaa", function() { +test("utf8str test", function() { equal(KJUR.asn1.ASN1Util.newObject({'utf8str': {'str': 'aaa'}}).getEncodedHex(), "0c03616161", "test1"); -}); - -test("utf8str test aaa", function() { equal(KJUR.asn1.ASN1Util.newObject({'utf8str': 'aaa'}).getEncodedHex(), "0c03616161", "test1"); }); -test("numstr test 123", function() { - equal(KJUR.asn1.ASN1Util.newObject({'numstr': {'str': '123'}}).getEncodedHex(), "1203313233", "test1"); -}); - -test("numstr test 123", function() { - equal(KJUR.asn1.ASN1Util.newObject({'numstr': '123'}).getEncodedHex(), "1203313233", "test1"); -}); - -test("prnstr test aaa", function() { - equal(KJUR.asn1.ASN1Util.newObject({'prnstr': {'str': 'aaa'}}).getEncodedHex(), "1303616161", "test1"); +test("numstr test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'numstr': {'str': '123'}}).getEncodedHex(), "1203313233", "{str: 123}"); + equal(KJUR.asn1.ASN1Util.newObject({'numstr': '123'}).getEncodedHex(), "1203313233", "123"); }); test("prnstr test aaa", function() { - equal(KJUR.asn1.ASN1Util.newObject({'prnstr': 'aaa'}).getEncodedHex(), "1303616161", "test1"); -}); - -test("telstr test aaa", function() { - equal(KJUR.asn1.ASN1Util.newObject({'telstr': {'str': 'aaa'}}).getEncodedHex(), "1403616161", "test1"); + equal(KJUR.asn1.ASN1Util.newObject({'prnstr': {'str': 'aaa'}}).getEncodedHex(), "1303616161", "{str: aaa}"); + equal(KJUR.asn1.ASN1Util.newObject({'prnstr': 'aaa'}).getEncodedHex(), "1303616161", "aaa"); }); -test("telstr test aaa", function() { - equal(KJUR.asn1.ASN1Util.newObject({'telstr': 'aaa'}).getEncodedHex(), "1403616161", "test1"); +test("telstr test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'telstr': {'str': 'aaa'}}).getEncodedHex(), "1403616161", "{str: aaa}"); + equal(KJUR.asn1.ASN1Util.newObject({'telstr': 'aaa'}).getEncodedHex(), "1403616161", "aaa"); }); -test("ia5str test aaa", function() { +test("ia5str test", function() { equal(KJUR.asn1.ASN1Util.newObject({'ia5str': {'str': 'aaa'}}).getEncodedHex(), "1603616161", "test1"); -}); - -test("ia5str test aaa", function() { equal(KJUR.asn1.ASN1Util.newObject({'ia5str': 'aaa'}).getEncodedHex(), "1603616161", "test1"); }); -test("utctime test 491231235959Z", function() { +test("utctime test", function() { equal(KJUR.asn1.ASN1Util.newObject({'utctime': {'str': '491231235959Z'}}).getEncodedHex(), "170d3439313233313233353935395a", "test1"); -}); - -test("utctime test 491231235959Z", function() { equal(KJUR.asn1.ASN1Util.newObject({'utctime': '491231235959Z'}).getEncodedHex(), "170d3439313233313233353935395a", "test1"); }); -test("gentime test 20131231235959Z", function() { +test("gentime test", function() { equal(KJUR.asn1.ASN1Util.newObject({'gentime': {'str': '20131231235959Z'}}).getEncodedHex(), "180f32303133313233313233353935395a", "test1"); -}); - -test("gentime test 20131231235959Z", function() { equal(KJUR.asn1.ASN1Util.newObject({'gentime': '20131231235959Z'}).getEncodedHex(), "180f32303133313233313233353935395a", "test1"); }); -test("seq test [int 3]", function() { - equal(KJUR.asn1.ASN1Util.newObject({'seq': [{'int': 3}]}).getEncodedHex(), "3003020103", "test1"); +test("visstr test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'visstr': {'str': 'aaa'}}).getEncodedHex(), "1a03616161", "{str: aaa}"); + equal(KJUR.asn1.ASN1Util.newObject({'visstr': 'aaa'}).getEncodedHex(), "1a03616161", "aaa"); }); -test("seq test [int 3, int 4]", function() { - equal(KJUR.asn1.ASN1Util.newObject({'seq': [{'int': 3}, {'int': 4}]}).getEncodedHex(), "3006020103020104", "test1"); +test("bmpstr test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'bmpstr': {'str': 'aaa'}}).getEncodedHex(), "1e03616161", "{str: aaa}"); + equal(KJUR.asn1.ASN1Util.newObject({'bmpstr': 'aaa'}).getEncodedHex(), "1e03616161", "aaa"); }); -test("set test [int 3]", function() { - equal(KJUR.asn1.ASN1Util.newObject({'set': [{'int': 3}]}).getEncodedHex(), "3103020103", "test1"); +test("seq test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'seq': [{'int': 3}]}).getEncodedHex(), "3003020103", "[int 3]"); + equal(KJUR.asn1.ASN1Util.newObject({'seq': [{'int': 3}, {'int': 4}]}).getEncodedHex(), "3006020103020104", "[int 3, int 4]"); }); -test("set test [int 3, int 4]", function() { - equal(KJUR.asn1.ASN1Util.newObject({'set': [{'int': 3}, {'int': 4}]}).getEncodedHex(), "3106020103020104", "test1"); +test("set test", function() { + equal(KJUR.asn1.ASN1Util.newObject({'set': [{'int': 3}]}).getEncodedHex(), "3103020103", "[int 3]"); + equal(KJUR.asn1.ASN1Util.newObject({'set': [{'int': 3}, {'int': 4}]}).getEncodedHex(), "3106020103020104", "[int 3, int 4]"); }); test("tag test seq [int 3, int 4] implicit", function() { diff --git a/test/qunit-do-asn1.html b/test/qunit-do-asn1.html index 4e3c174a..2e9a0919 100755 --- a/test/qunit-do-asn1.html +++ b/test/qunit-do-asn1.html @@ -180,6 +180,22 @@ equal(d.getEncodedHex(), "1603e38182", "IA5String あ"); }); +test("VisibleString Test", function() { + var d = new KJUR.asn1.DERVisibleString(); + d.setString('aaa'); + equal(d.getEncodedHex(), "1a03616161", "VisibleString aaa=1a03616161"); + var d2 = new KJUR.asn1.DERVisibleString({str: 'bbb'}); + equal(d2.getEncodedHex(), "1a03626262", "VisibleString bbb=1a03626262"); +}); + +test("BMPString Test", function() { + var d = new KJUR.asn1.DERBMPString(); + d.setString('aaa'); + equal(d.getEncodedHex(), "1e03616161", "BMPString aaa=1a03616161"); + var d2 = new KJUR.asn1.DERBMPString({str: 'bbb'}); + equal(d2.getEncodedHex(), "1e03626262", "BMPString bbb=1a03626262"); +}); + test("UTCTime Test", function() { expect(5); diff --git a/test/qunit-do-asn1hex-dump.html b/test/qunit-do-asn1hex-dump.html index f2a10196..45b4ff86 100755 --- a/test/qunit-do-asn1hex-dump.html +++ b/test/qunit-do-asn1hex-dump.html @@ -231,6 +231,8 @@ "UTCTime 230501235959Z\n", "UTCTime 2023"); equal(ASN1HEX.dump('180f32303233303530313233353935395a'), "GeneralizedTime 20230501235959Z\n", "GenTime 2023"); + equal(ASN1HEX.dump('1a025553'), "VisualString 'US'\n", "VisualString US"); + equal(ASN1HEX.dump('1e025553'), "BMPString 'US'\n", "BMPString US"); var aIdx = ASN1HEX.getChildIdx("3006020101020102", 0); equal(aIdx.length, 2, "aIdx.length"); equal(aIdx[0], 4, "aIdx[0]"); diff --git a/test/qunit-do-asn1x509.html b/test/qunit-do-asn1x509.html index b1d3875b..91e4b37d 100755 --- a/test/qunit-do-asn1x509.html +++ b/test/qunit-do-asn1x509.html @@ -735,11 +735,175 @@ }); test("CRLEntry class test", function() { - expect(1); var e = new KJUR.asn1.x509.CRLEntry({'time':{'str':'130514235959Z'}, 'sn':{'int':3}}); equal(e.getEncodedHex(), "3012020103170d3133303531343233353935395a", "constructor/1"); }); +test("CertificatePolicies test", function() { +var _CertificatePolicies = KJUR.asn1.x509.CertificatePolicies; + +equal( +(new _CertificatePolicies({ +array: [ + { policyoid: "1.2.3.4.5", + array: [ + { cps: "https://example.com/repository" }, + { unotice: { + noticeref: { + org: {type: "ia5", str: "Sample Org"}, + noticenum: [{int: 5}, {hex: "01af"}] + }, + exptext: {type: "ia5", str: "Sample Policy"} + }} + ] + }, + { policyoid: "1.2.3.4.6", + array: [ + { cps: "https://example2.org/repository" }, + { unotice: { + noticeref: { + org: {type: "utf8", str: "Sample2 Org"}, + noticenum: [{int: 5}] + }, + exptext: {type: "utf8", str: "Sample2 Policy"} + }} + ] + } +], +critical: true +})).getEncodedHex(), +"3081e10603551d200101ff0481d63081d3306806042a0304053060302a06082b06010505070201161e68747470733a2f2f6578616d706c652e636f6d2f7265706f7369746f7279303206082b0601050507020230263015160a53616d706c65204f72673007020105020201af160d53616d706c6520506f6c696379306706042a030406305f302b06082b06010505070201161f68747470733a2f2f6578616d706c65322e6f72672f7265706f7369746f7279303006082b06010505070202302430120c0b53616d706c6532204f726730030201050c0e53616d706c653220506f6c696379", +"two policies 1.2.3.4.{5,6}"); + +equal( +(new _CertificatePolicies({ +array: [ + { policyoid: "2.23.140.1.2.1" }, + { policyoid: "1.3.6.1.4.1.44947.1.1.1", + array: [ + { cps: "https://cps.letsencrypt.org" }, + { unotice: { + exptext: {type: "utf8", + str: "This Certificate may only be relied upon by Relying Parties and only in accordance with the Certificate Policy found at https://letsencrypt.org/repository/"} + }} + ] + } +] +})).getEncodedHex(), +"3081ff0603551d200481f73081f43008060667810c0102013081e7060b2b0601040182df130101013081d7302706082b06010505070201161b68747470733a2f2f6370732e6c657473656e63727970742e6f72673081ab06082b0601050507020230819e0c819b54686973204365727469666963617465206d6179206f6e6c792062652072656c6965642075706f6e2062792052656c79696e67205061727469657320616e64206f6e6c7920696e206163636f7264616e636520776974682074686520436572746966696361746520506f6c69637920666f756e642061742068747470733a2f2f6c657473656e63727970742e6f72672f7265706f7369746f72792f", +"lets encrypt"); + +}); + +test("PolicyInformation test", function() { +var _PolicyInformation = KJUR.asn1.x509.PolicyInformation; + +equal( +(new _PolicyInformation({ + policyoid: "1.2.3.4.5", + array: [ + { cps: "https://example.com/repository" }, + { unotice: { + noticeref: { + org: {type: "ia5", str: "Sample Org"}, + noticenum: [{int: 5}, {hex: "01af"}] + }, + exptext: {type: "ia5", str: "Sample Policy"} + }} + ] +})).getEncodedHex(), +"306806042a0304053060302a06082b06010505070201161e68747470733a2f2f6578616d706c652e636f6d2f7265706f7369746f7279303206082b0601050507020230263015160a53616d706c65204f72673007020105020201af160d53616d706c6520506f6c696379", +"policyinformation 1.2.3.4.5 full" +); + +}); + +test("PolicyQualifierInfo test", function() { +var _PolicyQualifierInfo = KJUR.asn1.x509.PolicyQualifierInfo; + +equal( +(new _PolicyQualifierInfo({ + cps: "https://example.org/" +})).getEncodedHex(), +"302006082b06010505070201161468747470733a2f2f6578616d706c652e6f72672f", +"cps"); + +equal( +(new _PolicyQualifierInfo({ + unotice: { + noticeref: { + org: {type: "ia5", str: "Sample Org"}, + noticenum: [{int: 5}, {hex: "01af"}] + }, + exptext: {type: "ia5", str: "Sample Policy"} + } +})).getEncodedHex(), +"303206082b0601050507020230263015160a53616d706c65204f72673007020105020201af160d53616d706c6520506f6c696379", +"unotice"); + +}); + +test("UserNotice test", function() { +var _UserNotice = KJUR.asn1.x509.UserNotice; +equal( +(new _UserNotice({ + noticeref: { + org: {type: "ia5", str: "Sample Org"}, + noticenum: [{int: 5}, {hex: "01af"}] + }, + exptext: {type: "ia5", str: "Sample Policy"} +})).getEncodedHex(), +"30263015160a53616d706c65204f72673007020105020201af160d53616d706c6520506f6c696379", +"usernotice"); +}); + +test("NoticeReference test", function() { +var _NoticeReference = KJUR.asn1.x509.NoticeReference; + +equal( +(new _NoticeReference({ + org: {type: "bmp", str: "Sample Org"}, + noticenum: [{int: 3}, {hex: "01af"}] +})).getEncodedHex(), +"30151e0a53616d706c65204f72673007020103020201af", +"both"); + +equal( +(new _NoticeReference({ + org: {type: "bmp", str: "Sample Org"} +})).getEncodedHex(), +"300c1e0a53616d706c65204f7267", +"org only"); + +equal( +(new _NoticeReference({ + noticenum: [{int: 3}, {hex: "01af"}] +})).getEncodedHex(), +"30093007020103020201af", +"noticenum only"); +}); + +test("DisplayText test", function() { +var _DisplayText = KJUR.asn1.x509.DisplayText; +equal((new _DisplayText({str: 'aaa'})).getEncodedHex(), + "0c03616161", + "aaa(utf8 default)=0c03616161"); +equal((new _DisplayText({type: 'utf8', str: 'aaa'})).getEncodedHex(), + "0c03616161", + "utf8,aaa=0c03616161"); +equal((new _DisplayText({type: 'ia5', str: 'aaa'})).getEncodedHex(), + "1603616161", + "ia5str,aaa=1603616161"); +equal((new _DisplayText({type: 'vis', str: 'aaa'})).getEncodedHex(), + "1a03616161", + "vis,aaa=1a03616161"); +equal((new _DisplayText({type: 'bmp', str: 'aaa'})).getEncodedHex(), + "1e03616161", + "bmp,aaa=1e03616161"); +}); + + + }); -->