diff --git a/ChangeLog.txt b/ChangeLog.txt index e98a47f3..0fc864d4 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,13 @@ ChangeLog for jsrsasign +* Changes between 6.0.1 to 6.1.0 (2016-Sep-24) + - asn1ocsp 1.0.0 + - now start to add OCSP protocol support + - OCSP request ASN.1 classes are added + - fix API document in x509 and asn1 + - test/qunit-do-{asn1,asn1ocsp}.html added or updated + * Changes between 6.0.0 to 6.0.1 (2016-Sep-12) - old jsrsasign.js is used in npm package. now fixed. diff --git a/api/files.html b/api/files.html index c610b79b..8dd2c284 100644 --- a/api/files.html +++ b/api/files.html @@ -294,6 +294,18 @@

Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • @@ -503,6 +515,25 @@

    asn1hex-1.1.js

    + + +
    + +
    +

    asn1ocsp-1.0.js

    + + +
    + +
    Author:
    +
    Kenji Urushima kenji.urushima@gmail.com
    + + +
    Version:
    +
    1.0.0 (2016-Sep-22)
    + + +

    diff --git a/api/index.html b/api/index.html index 73788493..5476af72 100644 --- a/api/index.html +++ b/api/index.html @@ -294,6 +294,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • @@ -736,6 +748,42 @@

    KJUR.asn1.DERUTF8String
    +
    +

    KJUR.asn1.ocsp

    + +
    +
    + +
    +

    KJUR.asn1.ocsp.CertID

    + ASN.1 CertID class for OCSP +
    +
    + +
    +

    KJUR.asn1.ocsp.OCSPRequest

    + ASN.1 OCSPRequest class for OCSP +
    +
    + +
    +

    KJUR.asn1.ocsp.OCSPUtil

    + Utility class for OCSP +
    +
    + +
    +

    KJUR.asn1.ocsp.Request

    + ASN.1 Request class for OCSP +
    +
    + +
    +

    KJUR.asn1.ocsp.TBSRequest

    + ASN.1 TBSRequest class for OCSP +
    +
    +

    KJUR.asn1.tsp

    diff --git a/api/symbols/ASN1HEX.html b/api/symbols/ASN1HEX.html index f26029fd..4fdc1e33 100644 --- a/api/symbols/ASN1HEX.html +++ b/api/symbols/ASN1HEX.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/Base64x.html b/api/symbols/Base64x.html index 61768d74..e6ac63a2 100644 --- a/api/symbols/Base64x.html +++ b/api/symbols/Base64x.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KEYUTIL.html b/api/symbols/KEYUTIL.html index 4c0020b5..e350771d 100644 --- a/api/symbols/KEYUTIL.html +++ b/api/symbols/KEYUTIL.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.ASN1Object.html b/api/symbols/KJUR.asn1.ASN1Object.html index 3a7c1a81..58fa88e6 100644 --- a/api/symbols/KJUR.asn1.ASN1Object.html +++ b/api/symbols/KJUR.asn1.ASN1Object.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.ASN1Util.html b/api/symbols/KJUR.asn1.ASN1Util.html index 8f3da426..363c7b7b 100644 --- a/api/symbols/KJUR.asn1.ASN1Util.html +++ b/api/symbols/KJUR.asn1.ASN1Util.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractString.html b/api/symbols/KJUR.asn1.DERAbstractString.html index 3d71b450..51bbc736 100644 --- a/api/symbols/KJUR.asn1.DERAbstractString.html +++ b/api/symbols/KJUR.asn1.DERAbstractString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractStructured.html b/api/symbols/KJUR.asn1.DERAbstractStructured.html index eda24304..43ab7fa7 100644 --- a/api/symbols/KJUR.asn1.DERAbstractStructured.html +++ b/api/symbols/KJUR.asn1.DERAbstractStructured.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERAbstractTime.html b/api/symbols/KJUR.asn1.DERAbstractTime.html index a074f04c..fe409e70 100644 --- a/api/symbols/KJUR.asn1.DERAbstractTime.html +++ b/api/symbols/KJUR.asn1.DERAbstractTime.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERBitString.html b/api/symbols/KJUR.asn1.DERBitString.html index 41d57bd2..0ff7fe21 100644 --- a/api/symbols/KJUR.asn1.DERBitString.html +++ b/api/symbols/KJUR.asn1.DERBitString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERBoolean.html b/api/symbols/KJUR.asn1.DERBoolean.html index 957261ae..c1798c2a 100644 --- a/api/symbols/KJUR.asn1.DERBoolean.html +++ b/api/symbols/KJUR.asn1.DERBoolean.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DEREnumerated.html b/api/symbols/KJUR.asn1.DEREnumerated.html index 91d49a3a..ffebe067 100644 --- a/api/symbols/KJUR.asn1.DEREnumerated.html +++ b/api/symbols/KJUR.asn1.DEREnumerated.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERGeneralizedTime.html b/api/symbols/KJUR.asn1.DERGeneralizedTime.html index 8dc90da3..6140e6ab 100644 --- a/api/symbols/KJUR.asn1.DERGeneralizedTime.html +++ b/api/symbols/KJUR.asn1.DERGeneralizedTime.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERIA5String.html b/api/symbols/KJUR.asn1.DERIA5String.html index d5a19a27..373f5a50 100644 --- a/api/symbols/KJUR.asn1.DERIA5String.html +++ b/api/symbols/KJUR.asn1.DERIA5String.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERInteger.html b/api/symbols/KJUR.asn1.DERInteger.html index 97175781..4bfce70c 100644 --- a/api/symbols/KJUR.asn1.DERInteger.html +++ b/api/symbols/KJUR.asn1.DERInteger.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERNull.html b/api/symbols/KJUR.asn1.DERNull.html index 9701934d..654a23cc 100644 --- a/api/symbols/KJUR.asn1.DERNull.html +++ b/api/symbols/KJUR.asn1.DERNull.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERNumericString.html b/api/symbols/KJUR.asn1.DERNumericString.html index de0ae878..4f5412ce 100644 --- a/api/symbols/KJUR.asn1.DERNumericString.html +++ b/api/symbols/KJUR.asn1.DERNumericString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERObjectIdentifier.html b/api/symbols/KJUR.asn1.DERObjectIdentifier.html index 46c2ed10..bab5af86 100644 --- a/api/symbols/KJUR.asn1.DERObjectIdentifier.html +++ b/api/symbols/KJUR.asn1.DERObjectIdentifier.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DEROctetString.html b/api/symbols/KJUR.asn1.DEROctetString.html index e29c1ebf..18a494d9 100644 --- a/api/symbols/KJUR.asn1.DEROctetString.html +++ b/api/symbols/KJUR.asn1.DEROctetString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERPrintableString.html b/api/symbols/KJUR.asn1.DERPrintableString.html index becff373..bd6df3b0 100644 --- a/api/symbols/KJUR.asn1.DERPrintableString.html +++ b/api/symbols/KJUR.asn1.DERPrintableString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERSequence.html b/api/symbols/KJUR.asn1.DERSequence.html index 42df1be1..71138aad 100644 --- a/api/symbols/KJUR.asn1.DERSequence.html +++ b/api/symbols/KJUR.asn1.DERSequence.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERSet.html b/api/symbols/KJUR.asn1.DERSet.html index d7bdc14c..3b1859ba 100644 --- a/api/symbols/KJUR.asn1.DERSet.html +++ b/api/symbols/KJUR.asn1.DERSet.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERTaggedObject.html b/api/symbols/KJUR.asn1.DERTaggedObject.html index ead52db5..2d8b01d1 100644 --- a/api/symbols/KJUR.asn1.DERTaggedObject.html +++ b/api/symbols/KJUR.asn1.DERTaggedObject.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERTeletexString.html b/api/symbols/KJUR.asn1.DERTeletexString.html index e7eab647..83bff53d 100644 --- a/api/symbols/KJUR.asn1.DERTeletexString.html +++ b/api/symbols/KJUR.asn1.DERTeletexString.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERUTCTime.html b/api/symbols/KJUR.asn1.DERUTCTime.html index 2fed5894..66b06f64 100644 --- a/api/symbols/KJUR.asn1.DERUTCTime.html +++ b/api/symbols/KJUR.asn1.DERUTCTime.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.DERUTF8String.html b/api/symbols/KJUR.asn1.DERUTF8String.html index e61ad9ab..a05e42e3 100644 --- a/api/symbols/KJUR.asn1.DERUTF8String.html +++ b/api/symbols/KJUR.asn1.DERUTF8String.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.CAdESUtil.html b/api/symbols/KJUR.asn1.cades.CAdESUtil.html index dc29bb7a..0093b2e8 100644 --- a/api/symbols/KJUR.asn1.cades.CAdESUtil.html +++ b/api/symbols/KJUR.asn1.cades.CAdESUtil.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html index 2506d787..41e0dcf9 100644 --- a/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html +++ b/api/symbols/KJUR.asn1.cades.CompleteCertificateRefs.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherCertID.html b/api/symbols/KJUR.asn1.cades.OtherCertID.html index 10a6c8ba..8d0faad2 100644 --- a/api/symbols/KJUR.asn1.cades.OtherCertID.html +++ b/api/symbols/KJUR.asn1.cades.OtherCertID.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHash.html b/api/symbols/KJUR.asn1.cades.OtherHash.html index 1a9b7435..fd0f8d24 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHash.html +++ b/api/symbols/KJUR.asn1.cades.OtherHash.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html index a9c495b5..e7d42cd6 100644 --- a/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html +++ b/api/symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html index 02406715..586ba096 100644 --- a/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html +++ b/api/symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html index e17b7e51..d7851cbc 100644 --- a/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html +++ b/api/symbols/KJUR.asn1.cades.SignatureTimeStamp.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cades.html b/api/symbols/KJUR.asn1.cades.html index c9fbdd43..f07bcc6f 100644 --- a/api/symbols/KJUR.asn1.cades.html +++ b/api/symbols/KJUR.asn1.cades.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.Attribute.html b/api/symbols/KJUR.asn1.cms.Attribute.html index 277d6d8f..b7755a14 100644 --- a/api/symbols/KJUR.asn1.cms.Attribute.html +++ b/api/symbols/KJUR.asn1.cms.Attribute.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.AttributeList.html b/api/symbols/KJUR.asn1.cms.AttributeList.html index e24399ae..2f0a5de9 100644 --- a/api/symbols/KJUR.asn1.cms.AttributeList.html +++ b/api/symbols/KJUR.asn1.cms.AttributeList.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.CMSUtil.html b/api/symbols/KJUR.asn1.cms.CMSUtil.html index 371dede3..0960bf87 100644 --- a/api/symbols/KJUR.asn1.cms.CMSUtil.html +++ b/api/symbols/KJUR.asn1.cms.CMSUtil.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentInfo.html b/api/symbols/KJUR.asn1.cms.ContentInfo.html index 09b26662..609adb15 100644 --- a/api/symbols/KJUR.asn1.cms.ContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.ContentInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.ContentType.html b/api/symbols/KJUR.asn1.cms.ContentType.html index d2f26be0..126b04d7 100644 --- a/api/symbols/KJUR.asn1.cms.ContentType.html +++ b/api/symbols/KJUR.asn1.cms.ContentType.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html index dcedb435..1d5ca2c4 100644 --- a/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html +++ b/api/symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html index edf216ef..9617aa84 100644 --- a/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html +++ b/api/symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.MessageDigest.html b/api/symbols/KJUR.asn1.cms.MessageDigest.html index 7030bc89..7b61e1a2 100644 --- a/api/symbols/KJUR.asn1.cms.MessageDigest.html +++ b/api/symbols/KJUR.asn1.cms.MessageDigest.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.SignedData.html b/api/symbols/KJUR.asn1.cms.SignedData.html index b7226ffd..1ba52680 100644 --- a/api/symbols/KJUR.asn1.cms.SignedData.html +++ b/api/symbols/KJUR.asn1.cms.SignedData.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.SignerInfo.html b/api/symbols/KJUR.asn1.cms.SignerInfo.html index 26af36e3..2bc02321 100644 --- a/api/symbols/KJUR.asn1.cms.SignerInfo.html +++ b/api/symbols/KJUR.asn1.cms.SignerInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificate.html b/api/symbols/KJUR.asn1.cms.SigningCertificate.html index 9d8a38e8..4e81fc68 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificate.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificate.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html index be483a7c..80d0ca69 100644 --- a/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html +++ b/api/symbols/KJUR.asn1.cms.SigningCertificateV2.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.SigningTime.html b/api/symbols/KJUR.asn1.cms.SigningTime.html index fb7481b6..a43ddf50 100644 --- a/api/symbols/KJUR.asn1.cms.SigningTime.html +++ b/api/symbols/KJUR.asn1.cms.SigningTime.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.cms.html b/api/symbols/KJUR.asn1.cms.html index 79ae4ef1..a2206aed 100644 --- a/api/symbols/KJUR.asn1.cms.html +++ b/api/symbols/KJUR.asn1.cms.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.csr.CSRUtil.html b/api/symbols/KJUR.asn1.csr.CSRUtil.html index aa4c5be5..a1173512 100644 --- a/api/symbols/KJUR.asn1.csr.CSRUtil.html +++ b/api/symbols/KJUR.asn1.csr.CSRUtil.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequest.html b/api/symbols/KJUR.asn1.csr.CertificationRequest.html index 02ec1aff..47dba5a4 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequest.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequest.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html index b66be3c4..9844c4f3 100644 --- a/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html +++ b/api/symbols/KJUR.asn1.csr.CertificationRequestInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.csr.html b/api/symbols/KJUR.asn1.csr.html index de019e09..9dfa4e5f 100644 --- a/api/symbols/KJUR.asn1.csr.html +++ b/api/symbols/KJUR.asn1.csr.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.html b/api/symbols/KJUR.asn1.html index dc968a98..bdfd6a82 100644 --- a/api/symbols/KJUR.asn1.html +++ b/api/symbols/KJUR.asn1.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.ocsp.CertID.html b/api/symbols/KJUR.asn1.ocsp.CertID.html new file mode 100644 index 00000000..b7c808db --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.CertID.html @@ -0,0 +1,750 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp.CertID + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.ocsp.CertID +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + ASN.1 CertID class for OCSP + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      +
    + KJUR.asn1.ocsp.CertID(params) +
    +
    ASN.1 CertID class for OCSP
    +CertID ASN.1 class is defined in +RFC 6960 4.1.1.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
      +
    setByCert(issuerCert, subjectCert, algName) +
    +
    set CertID ASN.1 object by PEM certificates.
    +
      +
    setByValue(issuerNameHashHex, issuerKeyHashHex, serialNumberHex, algName) +
    +
    set CertID ASN.1 object by values.
    +
    + + + +
    + +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.ocsp.CertID(params) +
    + +
    + ASN.1 CertID class for OCSP
    +CertID ASN.1 class is defined in +RFC 6960 4.1.1. +
    +CertID ::= SEQUENCE {
    +  hashAlgorithm   AlgorithmIdentifier,
    +  issuerNameHash  OCTET STRING, -- Hash of issuer's DN
    +  issuerKeyHash   OCTET STRING, -- Hash of issuer's public key
    +  serialNumber    CertificateSerialNumber }
    +
    + +
    + + + +
    // default constructor
    +o = new KJUR.asn1.ocsp.CertID();
    +// constructor with certs (sha1 is used by default)
    +o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."});
    +// constructor with certs and sha256
    +o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"});
    +// constructor with values
    +o = new KJUR.asn1.ocsp.CertID({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"});
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    + + + setByCert(issuerCert, subjectCert, algName) + +
    +
    + set CertID ASN.1 object by PEM certificates.
    + + +
    + + + +
    o = new KJUR.asn1.ocsp.CertID();
    +o.setByCert("-----BEGIN...", "-----BEGIN..."); // sha1 is used by default
    +o.setByCert("-----BEGIN...", "-----BEGIN...", "sha256");
    + + + + +
    +
    Parameters:
    + +
    + {String} issuerCert + +
    +
    string of PEM issuer certificate
    + +
    + {String} subjectCert + +
    +
    string of PEM subject certificate to be verified by OCSP
    + +
    + {String} algName + +
    +
    hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + + +
    + + +
    + + + setByValue(issuerNameHashHex, issuerKeyHashHex, serialNumberHex, algName) + +
    +
    + set CertID ASN.1 object by values.
    + + +
    + + + +
    o = new KJUR.asn1.ocsp.CertID();
    +o.setByValue("1fac...", "fd3a...", "1234"); // sha1 is used by default
    +o.setByValue("1fac...", "fd3a...", "1234", "sha256");
    + + + + +
    +
    Parameters:
    + +
    + {String} issuerNameHashHex + +
    +
    hexadecimal string of hash value of issuer name
    + +
    + {String} issuerKeyHashHex + +
    +
    hexadecimal string of hash value of issuer public key
    + +
    + {String} serialNumberHex + +
    +
    hexadecimal string of certificate serial number to be verified
    + +
    + {String} algName + +
    +
    hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html new file mode 100644 index 00000000..4c9c76cd --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.OCSPRequest.html @@ -0,0 +1,577 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp.OCSPRequest + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.ocsp.OCSPRequest +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + ASN.1 OCSPRequest class for OCSP + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    ASN.1 OCSPRequest class for OCSP
    +OCSPRequest ASN.1 class is defined in +RFC 6960 4.1.1.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.ocsp.OCSPRequest(params) +
    + +
    + ASN.1 OCSPRequest class for OCSP
    +OCSPRequest ASN.1 class is defined in +RFC 6960 4.1.1. +A signed request is not supported yet in this version. +
    +OCSPRequest ::= SEQUENCE {
    +  tbsRequest             TBSRequest,
    +  optionalSignature  [0] EXPLICIT Signature OPTIONAL }
    +
    + +
    + + + +
    // default constructor
    +o = new KJUR.asn1.ocsp.OCSPRequest();
    +// constructor with requestList parameter
    +o = new KJUR.asn1.ocsp.OCSPRequest({reqList:[
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +]});
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html new file mode 100644 index 00000000..4e82c7b3 --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.OCSPUtil.html @@ -0,0 +1,640 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp.OCSPUtil + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.ocsp.OCSPUtil +

    + + +

    + + + + Utility class for OCSP + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    Utility class for OCSP
    +This class provides utility static methods for OCSP.
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <static>   +
    KJUR.asn1.ocsp.OCSPUtil.getRequestHex(issuerCert, subjectCert, algName) +
    +
    generates hexadecimal string of OCSP request
    +This static method generates hexadecimal string of OCSP request.
    +
    + + + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.ocsp.OCSPUtil() +
    + +
    + Utility class for OCSP
    +This class provides utility static methods for OCSP. + + +
    + + + + + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    <static> + + {String} + KJUR.asn1.ocsp.OCSPUtil.getRequestHex(issuerCert, subjectCert, algName) + +
    +
    + generates hexadecimal string of OCSP request
    +This static method generates hexadecimal string of OCSP request. + + +
    + + + +
    // generate OCSP request using sha1 algorithnm by default.
    +hReq = KJUR.asn1.ocsp.OCSPUtil.getRequestHex("-----BEGIN...", "-----BEGIN...");
    + + + + +
    +
    Parameters:
    + +
    + {String} issuerCert + +
    +
    string of PEM issuer certificate
    + +
    + {String} subjectCert + +
    +
    string of PEM subject certificate to be verified by OCSP
    + +
    + {String} algName + +
    +
    hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + +
    +
    Returns:
    + +
    {String} hexadecimal string of generated OCSP request
    + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.ocsp.Request.html b/api/symbols/KJUR.asn1.ocsp.Request.html new file mode 100644 index 00000000..0dfe4692 --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.Request.html @@ -0,0 +1,578 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp.Request + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.ocsp.Request +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + ASN.1 Request class for OCSP + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    ASN.1 Request class for OCSP
    +Request ASN.1 class is defined in +RFC 6960 4.1.1.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.ocsp.Request(params) +
    + +
    + ASN.1 Request class for OCSP
    +Request ASN.1 class is defined in +RFC 6960 4.1.1. +singleRequestExtensions is not supported yet in this version such as nonce. +
    +Request ::= SEQUENCE {
    +  reqCert                  CertID,
    +  singleRequestExtensions  [0] EXPLICIT Extensions OPTIONAL }
    +
    + +
    + + + +
    // default constructor
    +o = new KJUR.asn1.ocsp.Request();
    +// constructor with certs (sha1 is used by default)
    +o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."});
    +// constructor with certs and sha256
    +o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"});
    +// constructor with values
    +o = new KJUR.asn1.ocsp.Request({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"});
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.ocsp.TBSRequest.html b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html new file mode 100644 index 00000000..b9b338ac --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.TBSRequest.html @@ -0,0 +1,664 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp.TBSRequest + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class KJUR.asn1.ocsp.TBSRequest +

    + + +

    + +
    Extends + KJUR.asn1.ASN1Object.
    + + + ASN.1 TBSRequest class for OCSP + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    ASN.1 TBSRequest class for OCSP
    +TBSRequest ASN.1 class is defined in +RFC 6960 4.1.1.
    +
    + + + + + + + + +
    +
    Fields borrowed from class KJUR.asn1.ASN1Object:
    hL, hT, hTLV, hV, isModified
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
      + +
    set TBSRequest ASN.1 object by array of parameters.
    +
    + + + +
    + +
    + + + + + + + +
    +
    + Class Detail +
    + +
    + KJUR.asn1.ocsp.TBSRequest(params) +
    + +
    + ASN.1 TBSRequest class for OCSP
    +TBSRequest ASN.1 class is defined in +RFC 6960 4.1.1. +
    +TBSRequest ::= SEQUENCE {
    +  version            [0] EXPLICIT Version DEFAULT v1,
    +  requestorName      [1] EXPLICIT GeneralName OPTIONAL,
    +  requestList            SEQUENCE OF Request,
    +  requestExtensions  [2] EXPLICIT Extensions OPTIONAL }
    +
    + +
    + + + +
    // default constructor
    +o = new KJUR.asn1.ocsp.TBSRequest();
    +// constructor with requestList parameter
    +o = new KJUR.asn1.ocsp.TBSRequest({reqList:[
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +]});
    + + + + + +
    +
    Parameters:
    + +
    + {Array} params + +
    +
    associative array of parameters
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    + + + setRequestListByParam(aParams) + +
    +
    + set TBSRequest ASN.1 object by array of parameters.
    + + +
    + + + +
    o = new KJUR.asn1.ocsp.TBSRequest();
    +o.setRequestListByParam([
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +  {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +]);
    + + + + +
    +
    Parameters:
    + +
    + {Array} aParams + +
    +
    array of parameters for Request class
    + +
    + + + +
    +
    Since:
    +
    jsrsasign 6.1.0 asn1ocsp 1.0.0
    +
    + + + + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.ocsp.html b/api/symbols/KJUR.asn1.ocsp.html new file mode 100644 index 00000000..47e892f4 --- /dev/null +++ b/api/symbols/KJUR.asn1.ocsp.html @@ -0,0 +1,614 @@ + + + + + + + jsrsasign 4.8.7 JavaScript API Reference - KJUR.asn1.ocsp + + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Namespace KJUR.asn1.ocsp +

    + + +

    + + + + + + +
    Defined in: asn1ocsp-1.0.js. + +

    + + + + + + + + + + + + + + + + + +
    Namespace Summary
    Constructor AttributesConstructor Name and Description
      + +
    ASN.1 classes for OCSP protocol
    +

    +This name space provides +RFC 6960 +Online Certificate Status Protocol (OCSP) ASN.1 request and response generator.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    Method AttributesMethod Name and Description
    <static>   +
    KJUR.asn1.ocsp.getEncodedHex() +
    +
    +
    + + + + + + + + + +
    +
    + Namespace Detail +
    + +
    + KJUR.asn1.ocsp +
    + +
    + ASN.1 classes for OCSP protocol
    +

    +This name space provides +RFC 6960 +Online Certificate Status Protocol (OCSP) ASN.1 request and response generator. + +

    FEATURES

    +
      +
    • easily generate OCSP data
    • +
    + +

    PROVIDED CLASSES

    + +

    + +
    + + + + + + + + + + + + +
    + + + + + + + +
    + Method Detail +
    + + +
    <static> + + + KJUR.asn1.ocsp.getEncodedHex() + +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + © 2012-2015 Kenji Urushima, All rights reserved
    + + Documentation generated by JsDoc Toolkit 2.4.0 +
    + + diff --git a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html index e2642c0c..36635026 100644 --- a/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.Accuracy.html b/api/symbols/KJUR.asn1.tsp.Accuracy.html index 6e821564..b1b17586 100644 --- a/api/symbols/KJUR.asn1.tsp.Accuracy.html +++ b/api/symbols/KJUR.asn1.tsp.Accuracy.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html index e7533c7b..e83fb69b 100644 --- a/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.FixedTSAAdapter.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.MessageImprint.html b/api/symbols/KJUR.asn1.tsp.MessageImprint.html index 9cd6c2dd..e46a8a1b 100644 --- a/api/symbols/KJUR.asn1.tsp.MessageImprint.html +++ b/api/symbols/KJUR.asn1.tsp.MessageImprint.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html index b8068735..58cdf944 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFailureInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html index 3a6f7bc7..3130e214 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIFreeText.html +++ b/api/symbols/KJUR.asn1.tsp.PKIFreeText.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatus.html b/api/symbols/KJUR.asn1.tsp.PKIStatus.html index bf6e9c2e..293aaa40 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatus.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatus.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html index 8e2bb21c..e7e0f61a 100644 --- a/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html +++ b/api/symbols/KJUR.asn1.tsp.PKIStatusInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html index 1c250cc6..e75cd6a6 100644 --- a/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html +++ b/api/symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSPUtil.html b/api/symbols/KJUR.asn1.tsp.TSPUtil.html index 836c741d..833548c7 100644 --- a/api/symbols/KJUR.asn1.tsp.TSPUtil.html +++ b/api/symbols/KJUR.asn1.tsp.TSPUtil.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.TSTInfo.html b/api/symbols/KJUR.asn1.tsp.TSTInfo.html index 27063d71..04aff989 100644 --- a/api/symbols/KJUR.asn1.tsp.TSTInfo.html +++ b/api/symbols/KJUR.asn1.tsp.TSTInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html index 619c6e4d..67e620e6 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampReq.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampReq.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html index b191a822..51fb37fd 100644 --- a/api/symbols/KJUR.asn1.tsp.TimeStampResp.html +++ b/api/symbols/KJUR.asn1.tsp.TimeStampResp.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.tsp.html b/api/symbols/KJUR.asn1.tsp.html index 3fc5cdd3..123c1fb2 100644 --- a/api/symbols/KJUR.asn1.tsp.html +++ b/api/symbols/KJUR.asn1.tsp.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html index a5520cbc..941ea116 100644 --- a/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AlgorithmIdentifier.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • @@ -496,7 +508,7 @@

    -
    
    +				
    algId1 = new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"});
    diff --git a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html index 22732932..4ca4f060 100644 --- a/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html +++ b/api/symbols/KJUR.asn1.x509.AttributeTypeAndValue.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html index 3c1d9388..4ba9ff4d 100644 --- a/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html +++ b/api/symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.BasicConstraints.html b/api/symbols/KJUR.asn1.x509.BasicConstraints.html index 16a202df..0c35dae8 100644 --- a/api/symbols/KJUR.asn1.x509.BasicConstraints.html +++ b/api/symbols/KJUR.asn1.x509.BasicConstraints.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.CRL.html b/api/symbols/KJUR.asn1.x509.CRL.html index 3f94e129..7a003fbb 100644 --- a/api/symbols/KJUR.asn1.x509.CRL.html +++ b/api/symbols/KJUR.asn1.x509.CRL.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html index d61be6f3..963b38bd 100644 --- a/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html +++ b/api/symbols/KJUR.asn1.x509.CRLDistributionPoints.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.CRLEntry.html b/api/symbols/KJUR.asn1.x509.CRLEntry.html index 9a7a16b6..7f96341d 100644 --- a/api/symbols/KJUR.asn1.x509.CRLEntry.html +++ b/api/symbols/KJUR.asn1.x509.CRLEntry.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.Certificate.html b/api/symbols/KJUR.asn1.x509.Certificate.html index 8b40d14f..0259c859 100644 --- a/api/symbols/KJUR.asn1.x509.Certificate.html +++ b/api/symbols/KJUR.asn1.x509.Certificate.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPoint.html b/api/symbols/KJUR.asn1.x509.DistributionPoint.html index 3e081124..927f2d9c 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPoint.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPoint.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.DistributionPointName.html b/api/symbols/KJUR.asn1.x509.DistributionPointName.html index 1ee364f7..7d62f091 100644 --- a/api/symbols/KJUR.asn1.x509.DistributionPointName.html +++ b/api/symbols/KJUR.asn1.x509.DistributionPointName.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html index 68ed8e33..d9eb2dd5 100644 --- a/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.ExtKeyUsage.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.Extension.html b/api/symbols/KJUR.asn1.x509.Extension.html index fec1f3a9..c78f499f 100644 --- a/api/symbols/KJUR.asn1.x509.Extension.html +++ b/api/symbols/KJUR.asn1.x509.Extension.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralName.html b/api/symbols/KJUR.asn1.x509.GeneralName.html index 99f540e7..44baec1c 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralName.html +++ b/api/symbols/KJUR.asn1.x509.GeneralName.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.GeneralNames.html b/api/symbols/KJUR.asn1.x509.GeneralNames.html index 86af73c8..eba62991 100644 --- a/api/symbols/KJUR.asn1.x509.GeneralNames.html +++ b/api/symbols/KJUR.asn1.x509.GeneralNames.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.KeyUsage.html b/api/symbols/KJUR.asn1.x509.KeyUsage.html index f223476c..9af1a2fd 100644 --- a/api/symbols/KJUR.asn1.x509.KeyUsage.html +++ b/api/symbols/KJUR.asn1.x509.KeyUsage.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.OID.html b/api/symbols/KJUR.asn1.x509.OID.html index 3c2823ae..db4b83fc 100644 --- a/api/symbols/KJUR.asn1.x509.OID.html +++ b/api/symbols/KJUR.asn1.x509.OID.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.RDN.html b/api/symbols/KJUR.asn1.x509.RDN.html index 8921da1e..df23482f 100644 --- a/api/symbols/KJUR.asn1.x509.RDN.html +++ b/api/symbols/KJUR.asn1.x509.RDN.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html index cdbd0078..a45331d7 100644 --- a/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html +++ b/api/symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertList.html b/api/symbols/KJUR.asn1.x509.TBSCertList.html index ebeb6e7b..afbfea08 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertList.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertList.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.TBSCertificate.html b/api/symbols/KJUR.asn1.x509.TBSCertificate.html index 71caacb7..e860b502 100644 --- a/api/symbols/KJUR.asn1.x509.TBSCertificate.html +++ b/api/symbols/KJUR.asn1.x509.TBSCertificate.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.Time.html b/api/symbols/KJUR.asn1.x509.Time.html index 9324e887..58f1058d 100644 --- a/api/symbols/KJUR.asn1.x509.Time.html +++ b/api/symbols/KJUR.asn1.x509.Time.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.X500Name.html b/api/symbols/KJUR.asn1.x509.X500Name.html index c31dba90..ede402fa 100644 --- a/api/symbols/KJUR.asn1.x509.X500Name.html +++ b/api/symbols/KJUR.asn1.x509.X500Name.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.X509Util.html b/api/symbols/KJUR.asn1.x509.X509Util.html index 3dd73de4..d9eaed13 100644 --- a/api/symbols/KJUR.asn1.x509.X509Util.html +++ b/api/symbols/KJUR.asn1.x509.X509Util.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.asn1.x509.html b/api/symbols/KJUR.asn1.x509.html index a7195234..d1dcac0a 100644 --- a/api/symbols/KJUR.asn1.x509.html +++ b/api/symbols/KJUR.asn1.x509.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.DSA.html b/api/symbols/KJUR.crypto.DSA.html index b0ca6ceb..c2ee2539 100644 --- a/api/symbols/KJUR.crypto.DSA.html +++ b/api/symbols/KJUR.crypto.DSA.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.ECDSA.html b/api/symbols/KJUR.crypto.ECDSA.html index 7895d4e4..ca32664e 100644 --- a/api/symbols/KJUR.crypto.ECDSA.html +++ b/api/symbols/KJUR.crypto.ECDSA.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.ECParameterDB.html b/api/symbols/KJUR.crypto.ECParameterDB.html index d212135f..97967cb3 100644 --- a/api/symbols/KJUR.crypto.ECParameterDB.html +++ b/api/symbols/KJUR.crypto.ECParameterDB.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.Mac.html b/api/symbols/KJUR.crypto.Mac.html index 15469e0f..46463047 100644 --- a/api/symbols/KJUR.crypto.Mac.html +++ b/api/symbols/KJUR.crypto.Mac.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.MessageDigest.html b/api/symbols/KJUR.crypto.MessageDigest.html index 12980bda..85f84386 100644 --- a/api/symbols/KJUR.crypto.MessageDigest.html +++ b/api/symbols/KJUR.crypto.MessageDigest.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.OID.html b/api/symbols/KJUR.crypto.OID.html index 8cfe9545..ab8903d4 100644 --- a/api/symbols/KJUR.crypto.OID.html +++ b/api/symbols/KJUR.crypto.OID.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.Signature.html b/api/symbols/KJUR.crypto.Signature.html index b78cce4a..e4c0f5c3 100644 --- a/api/symbols/KJUR.crypto.Signature.html +++ b/api/symbols/KJUR.crypto.Signature.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.Util.html b/api/symbols/KJUR.crypto.Util.html index ceaa9482..dd9a0db3 100644 --- a/api/symbols/KJUR.crypto.Util.html +++ b/api/symbols/KJUR.crypto.Util.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.crypto.html b/api/symbols/KJUR.crypto.html index bbdb3e7f..20c0a579 100644 --- a/api/symbols/KJUR.crypto.html +++ b/api/symbols/KJUR.crypto.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.html b/api/symbols/KJUR.html index a5dcd9df..1b79497b 100644 --- a/api/symbols/KJUR.html +++ b/api/symbols/KJUR.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.jws.IntDate.html b/api/symbols/KJUR.jws.IntDate.html index 5973ce61..56f89cb9 100644 --- a/api/symbols/KJUR.jws.IntDate.html +++ b/api/symbols/KJUR.jws.IntDate.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.jws.JWS.html b/api/symbols/KJUR.jws.JWS.html index bcded1b4..d5e0989d 100644 --- a/api/symbols/KJUR.jws.JWS.html +++ b/api/symbols/KJUR.jws.JWS.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.jws.JWSJS.html b/api/symbols/KJUR.jws.JWSJS.html index edb45da4..0e0abbe1 100644 --- a/api/symbols/KJUR.jws.JWSJS.html +++ b/api/symbols/KJUR.jws.JWSJS.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.jws.html b/api/symbols/KJUR.jws.html index 87541518..76a7a6f1 100644 --- a/api/symbols/KJUR.jws.html +++ b/api/symbols/KJUR.jws.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/KJUR.lang.String.html b/api/symbols/KJUR.lang.String.html index 41cdb3c6..84e73167 100644 --- a/api/symbols/KJUR.lang.String.html +++ b/api/symbols/KJUR.lang.String.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/PKCS5PKEY.html b/api/symbols/PKCS5PKEY.html index 0072ff24..a9c28ed5 100644 --- a/api/symbols/PKCS5PKEY.html +++ b/api/symbols/PKCS5PKEY.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/RSAKey.html b/api/symbols/RSAKey.html index 52551277..6f2005f0 100644 --- a/api/symbols/RSAKey.html +++ b/api/symbols/RSAKey.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/X509.html b/api/symbols/X509.html index 6c34edff..8d7bc416 100644 --- a/api/symbols/X509.html +++ b/api/symbols/X509.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • @@ -798,6 +810,25 @@

    + + <static>   + + +
    get a string index of subjectPublicKeyInfo field from hexadecimal certificate
    +This static method gets a string index of subjectPublicKeyInfo field from hexadecimal certificate.
    + + + + + <static>   + + +
    get a string index of contents of subjectPublicKeyInfo BITSTRING value from hexadecimal certificate
    + + +   @@ -895,8 +926,8 @@

  • notAfter - X509#getNotAfter
  • subject - X509#getSubjectHex
  • subject - X509#getSubjectString
  • -
  • subjectPublicKeyInfo - X509.getSubjectPublicKeyPosFromCertHex
  • -
  • subjectPublicKeyInfo - X509.getSubjectPublicKeyInfoPosFromCertHex
  • +
  • subjectPublicKeyInfo - X509.getSubjectPublicKeyPosFromCertHex
  • +
  • subjectPublicKeyInfo - X509.getSubjectPublicKeyInfoPosFromCertHex
  • subjectPublicKeyInfo - X509.getPublicKeyFromCertPEM
  • signature algorithm - X509.getSignatureAlgorithmName
  • signature value - X509.getSignatureValueHex
  • @@ -2402,6 +2433,103 @@

    +
    + + +
    <static> + + {Integer} + X509.getSubjectPublicKeyInfoPosFromCertHex(hexadecimal) + +
    +
    + get a string index of subjectPublicKeyInfo field from hexadecimal certificate
    +This static method gets a string index of subjectPublicKeyInfo field from hexadecimal certificate.
    +NOTE1: privateKeyUsagePeriod field of X509v2 not supported.
    +NOTE2: X.509v1 and X.509v3 certificate are supported.
    + + +
    + + + +
    idx = X509.getSubjectPublicKeyInfoPosFromCertHex("3082...");
    + + + + +
    +
    Parameters:
    + +
    + {String} hexadecimal + +
    +
    string of DER RSA/ECDSA/DSA X.509 certificate
    + +
    + + + + + +
    +
    Returns:
    + +
    {Integer} string index of subjectPublicKeyInfo field
    + +
    + + + + +
    + + +
    <static> + + {Integer} + X509.getSubjectPublicKeyPosFromCertHex(hexadecimal) + +
    +
    + get a string index of contents of subjectPublicKeyInfo BITSTRING value from hexadecimal certificate
    + + +
    + + + +
    idx = X509.getSubjectPublicKeyPosFromCertHex("3082...");
    + + + + +
    +
    Parameters:
    + +
    + {String} hexadecimal + +
    +
    string of DER RSA/ECDSA/DSA X.509 certificate
    + +
    + + + + + +
    +
    Returns:
    + +
    {Integer} string index of key contents
    + +
    + + + +
    diff --git a/api/symbols/global__.html b/api/symbols/global__.html index 0f6acb87..a45a5fdf 100644 --- a/api/symbols/global__.html +++ b/api/symbols/global__.html @@ -299,6 +299,18 @@

    Classes

  • KJUR.asn1.DERUTF8String
  • +
  • KJUR.asn1.ocsp
  • + +
  • KJUR.asn1.ocsp.CertID
  • + +
  • KJUR.asn1.ocsp.OCSPRequest
  • + +
  • KJUR.asn1.ocsp.OCSPUtil
  • + +
  • KJUR.asn1.ocsp.Request
  • + +
  • KJUR.asn1.ocsp.TBSRequest
  • +
  • KJUR.asn1.tsp
  • KJUR.asn1.tsp.AbstractTSAAdapter
  • diff --git a/api/symbols/src/asn1ocsp-1.0.js.html b/api/symbols/src/asn1ocsp-1.0.js.html new file mode 100644 index 00000000..59a4ddac --- /dev/null +++ b/api/symbols/src/asn1ocsp-1.0.js.html @@ -0,0 +1,433 @@ +
      1 /*! asn1ocsp-1.0.0.js (c) 2016 Kenji Urushima | kjur.github.com/jsrsasign/license
    +  2  */
    +  3 /*
    +  4  * asn1ocsp.js - ASN.1 DER encoder classes for OCSP protocol
    +  5  *
    +  6  * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com)
    +  7  *
    +  8  * This software is licensed under the terms of the MIT License.
    +  9  * http://kjur.github.com/jsrsasign/license
    + 10  *
    + 11  * The above copyright and license notice shall be 
    + 12  * included in all copies or substantial portions of the Software.
    + 13  */
    + 14 
    + 15 /**
    + 16  * @fileOverview
    + 17  * @name asn1ocsp-1.0.js
    + 18  * @author Kenji Urushima kenji.urushima@gmail.com
    + 19  * @version 1.0.0 (2016-Sep-22)
    + 20  * @since jsrsasign 6.1.0
    + 21  * @license <a href="http://kjur.github.io/jsrsasign/license/">MIT License</a>
    + 22  */
    + 23 
    + 24 if (typeof KJUR == "undefined" || !KJUR) KJUR = {};
    + 25 if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {};
    + 26 
    + 27 /**
    + 28  * ASN.1 classes for OCSP protocol<br/>
    + 29  * <p>
    + 30  * This name space provides 
    + 31  * <a href="https://tools.ietf.org/html/rfc6960">RFC 6960
    + 32  * Online Certificate Status Protocol (OCSP)</a> ASN.1 request and response generator.
    + 33  *
    + 34  * <h4>FEATURES</h4>
    + 35  * <ul>
    + 36  * <li>easily generate OCSP data</li>
    + 37  * </ul>
    + 38  * 
    + 39  * <h4>PROVIDED CLASSES</h4>
    + 40  * <ul>
    + 41  * <li>{@link KJUR.asn1.ocsp.CertID} for ASN.1 class as defined in 
    + 42  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. </li>
    + 43  * <li>{@link KJUR.asn1.ocsp.Request} for ASN.1 class as defined in
    + 44  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. </li>
    + 45  * <li>{@link KJUR.asn1.ocsp.TBSRequest} for ASN.1 class as defined in
    + 46  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. </li>
    + 47  * <li>{@link KJUR.asn1.ocsp.OCSPRequest} for ASN.1 class as defined in
    + 48  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. </li>
    + 49  * <li>{@link KJUR.asn1.ocsp.OCSPUtil} for static utility methods.</li>
    + 50  * </ul>
    + 51  * </p>
    + 52  * @name KJUR.asn1.ocsp
    + 53  * @namespace
    + 54  */
    + 55 if (typeof KJUR.asn1.ocsp == "undefined" || !KJUR.asn1.ocsp) KJUR.asn1.ocsp = {};
    + 56 
    + 57 KJUR.asn1.ocsp.DEFAULT_HASH = "sha1";
    + 58 
    + 59 /**
    + 60  * ASN.1 CertID class for OCSP<br/>
    + 61  * @name KJUR.asn1.ocsp.CertID
    + 62  * @class ASN.1 CertID class for OCSP
    + 63  * @param {Array} params associative array of parameters
    + 64  * @extends KJUR.asn1.ASN1Object
    + 65  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    + 66  * @description
    + 67  * CertID ASN.1 class is defined in 
    + 68  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. 
    + 69  * <pre>
    + 70  * CertID ::= SEQUENCE {
    + 71  *   hashAlgorithm   AlgorithmIdentifier,
    + 72  *   issuerNameHash  OCTET STRING, -- Hash of issuer's DN
    + 73  *   issuerKeyHash   OCTET STRING, -- Hash of issuer's public key
    + 74  *   serialNumber    CertificateSerialNumber }
    + 75  * </pre>
    + 76  * @example
    + 77  * // default constructor
    + 78  * o = new KJUR.asn1.ocsp.CertID();
    + 79  * // constructor with certs (sha1 is used by default)
    + 80  * o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."});
    + 81  * // constructor with certs and sha256
    + 82  * o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"});
    + 83  * // constructor with values
    + 84  * o = new KJUR.asn1.ocsp.CertID({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"});
    + 85  */
    + 86 KJUR.asn1.ocsp.CertID = function(params) {
    + 87     KJUR.asn1.ocsp.CertID.superclass.constructor.call(this);
    + 88     var nA = KJUR.asn1;
    + 89     var nX = KJUR.asn1.x509;
    + 90     this.dHashAlg = null;
    + 91     this.dIssuerNameHash = null;
    + 92     this.dIssuerKeyHash = null;
    + 93     this.dSerialNumber = null;
    + 94 
    + 95     /**
    + 96      * set CertID ASN.1 object by values.<br/>
    + 97      * @name setByValue
    + 98      * @memberOf KJUR.asn1.ocsp.CertID#
    + 99      * @function
    +100      * @param {String} issuerNameHashHex hexadecimal string of hash value of issuer name
    +101      * @param {String} issuerKeyHashHex hexadecimal string of hash value of issuer public key
    +102      * @param {String} serialNumberHex hexadecimal string of certificate serial number to be verified
    +103      * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    +104      * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +105      * @example
    +106      * o = new KJUR.asn1.ocsp.CertID();
    +107      * o.setByValue("1fac...", "fd3a...", "1234"); // sha1 is used by default
    +108      * o.setByValue("1fac...", "fd3a...", "1234", "sha256");
    +109      */
    +110     this.setByValue = function(issuerNameHashHex, issuerKeyHashHex,
    +111 			       serialNumberHex, algName) {
    +112 	if (algName === undefined)
    +113 	    algName = KJUR.asn1.ocsp.DEFAULT_HASH;
    +114 	this.dHashAlg =        new nX.AlgorithmIdentifier({name: algName});
    +115 	this.dIssuerNameHash = new nA.DEROctetString({hex: issuerNameHashHex});
    +116 	this.dIssuerKeyHash =  new nA.DEROctetString({hex: issuerKeyHashHex});
    +117 	this.dSerialNumber =   new nA.DERInteger({hex: serialNumberHex});
    +118     };
    +119 
    +120     /**
    +121      * set CertID ASN.1 object by PEM certificates.<br/>
    +122      * @name setByCert
    +123      * @memberOf KJUR.asn1.ocsp.CertID#
    +124      * @function
    +125      * @param {String} issuerCert string of PEM issuer certificate
    +126      * @param {String} subjectCert string of PEM subject certificate to be verified by OCSP
    +127      * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    +128      * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +129      * @example
    +130      * o = new KJUR.asn1.ocsp.CertID();
    +131      * o.setByCert("-----BEGIN...", "-----BEGIN..."); // sha1 is used by default
    +132      * o.setByCert("-----BEGIN...", "-----BEGIN...", "sha256");
    +133      */
    +134     this.setByCert = function(issuerCert, subjectCert, algName) {
    +135 	if (algName === undefined)
    +136 	    algName = KJUR.asn1.ocsp.DEFAULT_HASH;
    +137 
    +138 	var xSbj = new X509();
    +139 	xSbj.readCertPEM(subjectCert);
    +140 	var xIss = new X509();
    +141 	xIss.readCertPEM(issuerCert);
    +142 	var kiPropIss = X509.getPublicKeyInfoPropOfCertPEM(issuerCert);
    +143         var issuerKeyHex = kiPropIss.keyhex;
    +144 
    +145 	var serialNumberHex = xSbj.getSerialNumberHex();
    +146 	var issuerNameHashHex = KJUR.crypto.Util.hashHex(xIss.getSubjectHex(), algName);
    +147 	var issuerKeyHashHex = KJUR.crypto.Util.hashHex(issuerKeyHex, algName);
    +148 	this.setByValue(issuerNameHashHex, issuerKeyHashHex,
    +149 			serialNumberHex, algName);
    +150 	this.hoge = xSbj.getSerialNumberHex();
    +151     };
    +152 
    +153     this.getEncodedHex = function() {
    +154 	if (this.dHashAlg === null && 
    +155 	    this.dIssuerNameHash === null &&
    +156 	    this.dIssuerKeyHash === null &&
    +157 	    this.dSerialNumber === null)
    +158 	    throw "not yet set values";
    +159 
    +160 	var a = [this.dHashAlg, this.dIssuerNameHash,
    +161 		 this.dIssuerKeyHash, this.dSerialNumber];
    +162 	var seq = new nA.DERSequence({array: a});
    +163         this.hTLV = seq.getEncodedHex();
    +164         return this.hTLV;
    +165     };
    +166 
    +167     if (typeof params !== "undefined") {
    +168 	var p = params;
    +169 	if (typeof p.issuerCert !== "undefined" &&
    +170 	    typeof p.subjectCert !== "undefined") {
    +171 	    var alg = KJUR.asn1.ocsp.DEFAULT_HASH;
    +172 	    if (typeof p.alg === "undefined") alg = undefined;
    +173 	    this.setByCert(p.issuerCert, p.subjectCert, alg);
    +174 	} else if (typeof p.namehash !== "undefined" &&
    +175 		   typeof p.keyhash !== "undefined" &&
    +176 		   typeof p.serial !== "undefined") {
    +177 	    var alg = KJUR.asn1.ocsp.DEFAULT_HASH;
    +178 	    if (typeof p.alg === "undefined") alg = undefined;
    +179 	    this.setByValue(p.namehash, p.keyhash, p.serial, alg);
    +180 	} else {
    +181 	    throw "invalid constructor arguments";
    +182 	}
    +183     }
    +184 };
    +185 YAHOO.lang.extend(KJUR.asn1.ocsp.CertID, KJUR.asn1.ASN1Object);
    +186 
    +187 /**
    +188  * ASN.1 Request class for OCSP<br/>
    +189  * @name KJUR.asn1.ocsp.Request
    +190  * @class ASN.1 Request class for OCSP
    +191  * @param {Array} params associative array of parameters
    +192  * @extends KJUR.asn1.ASN1Object
    +193  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +194  * @description
    +195  * Request ASN.1 class is defined in 
    +196  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. 
    +197  * singleRequestExtensions is not supported yet in this version such as nonce.
    +198  * <pre>
    +199  * Request ::= SEQUENCE {
    +200  *   reqCert                  CertID,
    +201  *   singleRequestExtensions  [0] EXPLICIT Extensions OPTIONAL }
    +202  * </pre>
    +203  * @example
    +204  * // default constructor
    +205  * o = new KJUR.asn1.ocsp.Request();
    +206  * // constructor with certs (sha1 is used by default)
    +207  * o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."});
    +208  * // constructor with certs and sha256
    +209  * o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"});
    +210  * // constructor with values
    +211  * o = new KJUR.asn1.ocsp.Request({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"});
    +212  */
    +213 KJUR.asn1.ocsp.Request = function(params) {
    +214     KJUR.asn1.ocsp.Request.superclass.constructor.call(this);
    +215     this.dReqCert = null;
    +216     this.dExt = null;
    +217     
    +218     this.getEncodedHex = function() {
    +219 	var a = [];
    +220 
    +221 	// 1. reqCert
    +222 	if (this.dReqCert === null)
    +223 	    throw "reqCert not set";
    +224 	a.push(this.dReqCert);
    +225 
    +226 	// 2. singleRequestExtensions (not supported yet)
    +227 
    +228 	// 3. construct SEQUENCE
    +229 	var seq = new KJUR.asn1.DERSequence({array: a});
    +230         this.hTLV = seq.getEncodedHex();
    +231         return this.hTLV;
    +232     };
    +233 
    +234     if (typeof params !== "undefined") {
    +235 	var o = new KJUR.asn1.ocsp.CertID(params);
    +236 	this.dReqCert = o;
    +237     }
    +238 };
    +239 YAHOO.lang.extend(KJUR.asn1.ocsp.Request, KJUR.asn1.ASN1Object);
    +240 
    +241 /**
    +242  * ASN.1 TBSRequest class for OCSP<br/>
    +243  * @name KJUR.asn1.ocsp.TBSRequest
    +244  * @class ASN.1 TBSRequest class for OCSP
    +245  * @param {Array} params associative array of parameters
    +246  * @extends KJUR.asn1.ASN1Object
    +247  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +248  * @description
    +249  * TBSRequest ASN.1 class is defined in 
    +250  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. 
    +251  * <pre>
    +252  * TBSRequest ::= SEQUENCE {
    +253  *   version            [0] EXPLICIT Version DEFAULT v1,
    +254  *   requestorName      [1] EXPLICIT GeneralName OPTIONAL,
    +255  *   requestList            SEQUENCE OF Request,
    +256  *   requestExtensions  [2] EXPLICIT Extensions OPTIONAL }
    +257  * </pre>
    +258  * @example
    +259  * // default constructor
    +260  * o = new KJUR.asn1.ocsp.TBSRequest();
    +261  * // constructor with requestList parameter
    +262  * o = new KJUR.asn1.ocsp.TBSRequest({reqList:[
    +263  *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +264  *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +265  * ]});
    +266  */
    +267 KJUR.asn1.ocsp.TBSRequest = function(params) {
    +268     KJUR.asn1.ocsp.TBSRequest.superclass.constructor.call(this);
    +269     this.version = 0;
    +270     this.dRequestorName = null;
    +271     this.dRequestList = [];
    +272     this.dRequestExt = null;
    +273 
    +274     /**
    +275      * set TBSRequest ASN.1 object by array of parameters.<br/>
    +276      * @name setRequestListByParam
    +277      * @memberOf KJUR.asn1.ocsp.TBSRequest#
    +278      * @function
    +279      * @param {Array} aParams array of parameters for Request class
    +280      * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +281      * @example
    +282      * o = new KJUR.asn1.ocsp.TBSRequest();
    +283      * o.setRequestListByParam([
    +284      *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +285      *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +286      * ]);
    +287      */
    +288     this.setRequestListByParam = function(aParams) {
    +289 	var a = [];
    +290 	for (var i = 0; i < aParams.length; i++) {
    +291 	    var dReq = new KJUR.asn1.ocsp.Request(aParams[0]);
    +292 	    a.push(dReq);
    +293 	}
    +294 	this.dRequestList = a;
    +295     };
    +296 
    +297     this.getEncodedHex = function() {
    +298 	var a = [];
    +299 
    +300 	// 1. version
    +301 	if (this.version !== 0)
    +302 	    throw "not supported version: " + this.version;
    +303 
    +304 	// 2. requestorName
    +305 	if (this.dRequestorName !== null)
    +306 	    throw "requestorName not supported";
    +307 
    +308 	// 3. requestList
    +309 	var seqRequestList = 
    +310 	    new KJUR.asn1.DERSequence({array: this.dRequestList});
    +311 	a.push(seqRequestList);
    +312 
    +313 	// 4. requestExtensions
    +314 	if (this.dRequestExt !== null)
    +315 	    throw "requestExtensions not supported";
    +316 
    +317 	// 5. construct SEQUENCE
    +318 	var seq = new KJUR.asn1.DERSequence({array: a});
    +319         this.hTLV = seq.getEncodedHex();
    +320         return this.hTLV;
    +321     };
    +322 
    +323     if (typeof params !== "undefined") {
    +324 	if (typeof params.reqList !== "undefined")
    +325 	    this.setRequestListByParam(params.reqList);
    +326     }
    +327 };
    +328 YAHOO.lang.extend(KJUR.asn1.ocsp.TBSRequest, KJUR.asn1.ASN1Object);
    +329 
    +330 
    +331 /**
    +332  * ASN.1 OCSPRequest class for OCSP<br/>
    +333  * @name KJUR.asn1.ocsp.OCSPRequest
    +334  * @class ASN.1 OCSPRequest class for OCSP
    +335  * @param {Array} params associative array of parameters
    +336  * @extends KJUR.asn1.ASN1Object
    +337  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +338  * @description
    +339  * OCSPRequest ASN.1 class is defined in 
    +340  * <a href="https://tools.ietf.org/html/rfc6960#section-4.1.1">RFC 6960 4.1.1</a>. 
    +341  * A signed request is not supported yet in this version.
    +342  * <pre>
    +343  * OCSPRequest ::= SEQUENCE {
    +344  *   tbsRequest             TBSRequest,
    +345  *   optionalSignature  [0] EXPLICIT Signature OPTIONAL }
    +346  * </pre>
    +347  * @example
    +348  * // default constructor
    +349  * o = new KJUR.asn1.ocsp.OCSPRequest();
    +350  * // constructor with requestList parameter
    +351  * o = new KJUR.asn1.ocsp.OCSPRequest({reqList:[
    +352  *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:},
    +353  *   {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}
    +354  * ]});
    +355  */
    +356 KJUR.asn1.ocsp.OCSPRequest = function(params) {
    +357     KJUR.asn1.ocsp.OCSPRequest.superclass.constructor.call(this);
    +358     this.dTbsRequest = null;
    +359     this.dOptionalSignature = null;
    +360 
    +361     this.getEncodedHex = function() {
    +362 	var a = [];
    +363 
    +364 	// 1. tbsRequest
    +365 	if (this.dTbsRequest !== null) {
    +366 	    a.push(this.dTbsRequest);
    +367 	} else {
    +368 	    throw "tbsRequest not set";
    +369 	}
    +370 
    +371 	// 2. optionalSignature
    +372 	if (this.dOptionalSignature !== null)
    +373 	    throw "optionalSignature not supported";
    +374 
    +375 	// 3. construct SEQUENCE
    +376 	var seq = new KJUR.asn1.DERSequence({array: a});
    +377         this.hTLV = seq.getEncodedHex();
    +378         return this.hTLV;
    +379     };
    +380 
    +381     if (typeof params !== "undefined") {
    +382 	if (typeof params.reqList !== "undefined") {
    +383 	    var o = new KJUR.asn1.ocsp.TBSRequest(params);
    +384 	    this.dTbsRequest = o;
    +385 	}
    +386     }
    +387 };
    +388 YAHOO.lang.extend(KJUR.asn1.ocsp.OCSPRequest, KJUR.asn1.ASN1Object);
    +389 
    +390 /**
    +391  * Utility class for OCSP<br/>
    +392  * @name KJUR.asn1.ocsp.OCSPUtil
    +393  * @class Utility class for OCSP
    +394  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +395  * @description
    +396  * This class provides utility static methods for OCSP.
    +397  * <ul>
    +398  * <li>{@link KJUR.asn1.ocsp.OCSPUtil.getRequestHex} - generates hexadecimal string of OCSP request</li>
    +399  * </ul>
    +400  */
    +401 KJUR.asn1.ocsp.OCSPUtil = {};
    +402 
    +403 /**
    +404  * generates hexadecimal string of OCSP request<br/>
    +405  * @name getRequestHex
    +406  * @memberOf KJUR.asn1.ocsp.OCSPUtil
    +407  * @function
    +408  * @param {String} issuerCert string of PEM issuer certificate
    +409  * @param {String} subjectCert string of PEM subject certificate to be verified by OCSP
    +410  * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1
    +411  * @return {String} hexadecimal string of generated OCSP request
    +412  * @since jsrsasign 6.1.0 asn1ocsp 1.0.0
    +413  * @description
    +414  * This static method generates hexadecimal string of OCSP request.
    +415  * @example
    +416  * // generate OCSP request using sha1 algorithnm by default.
    +417  * hReq = KJUR.asn1.ocsp.OCSPUtil.getRequestHex("-----BEGIN...", "-----BEGIN...");
    +418  */
    +419 KJUR.asn1.ocsp.OCSPUtil.getRequestHex = function(issuerCert, subjectCert, alg) {
    +420     if (alg === undefined) alg = KJUR.asn1.ocsp.DEFAULT_HASH;
    +421     var param = {alg: alg, issuerCert: issuerCert, subjectCert: subjectCert};
    +422     var o = new KJUR.asn1.ocsp.OCSPRequest({reqList: [param]});
    +423     return o.getEncodedHex();
    +424 };
    +425 
    +426 
    \ 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 e31d81a2..b37c5111 100644 --- a/api/symbols/src/asn1x509-1.0.js.html +++ b/api/symbols/src/asn1x509-1.0.js.html @@ -1527,643 +1527,644 @@ 1520 * @extends KJUR.asn1.ASN1Object 1521 * @description 1522 * @example -1523 */ -1524 KJUR.asn1.x509.AlgorithmIdentifier = function(params) { -1525 KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this); -1526 var nameAlg = null; -1527 var asn1Alg = null; -1528 var asn1Params = null; -1529 var paramEmpty = false; -1530 -1531 this.getEncodedHex = function() { -1532 if (this.nameAlg == null && this.asn1Alg == null) { -1533 throw "algorithm not specified"; -1534 } -1535 if (this.nameAlg != null && this.asn1Alg == null) { -1536 this.asn1Alg = KJUR.asn1.x509.OID.name2obj(this.nameAlg); -1537 } -1538 var a = [this.asn1Alg]; -1539 if (! this.paramEmpty) a.push(this.asn1Params); -1540 var o = new KJUR.asn1.DERSequence({'array': a}); -1541 this.hTLV = o.getEncodedHex(); -1542 return this.hTLV; -1543 }; -1544 -1545 if (typeof params != "undefined") { -1546 if (typeof params['name'] != "undefined") { -1547 this.nameAlg = params['name']; -1548 } -1549 if (typeof params['asn1params'] != "undefined") { -1550 this.asn1Params = params['asn1params']; -1551 } -1552 if (typeof params['paramempty'] != "undefined") { -1553 this.paramEmpty = params['paramempty']; -1554 } -1555 } -1556 if (this.asn1Params == null) { -1557 this.asn1Params = new KJUR.asn1.DERNull(); -1558 } -1559 }; -1560 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object); -1561 -1562 /** -1563 * GeneralName ASN.1 structure class -1564 * @name KJUR.asn1.x509.GeneralName -1565 * @class GeneralName ASN.1 structure class -1566 * @description -1567 * <br/> -1568 * As for argument 'params' for constructor, you can specify one of -1569 * following properties: -1570 * <ul> -1571 * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li> -1572 * <li>dns - dNSName[2] (ex. foo.com)</li> -1573 * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li> -1574 * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li> -1575 * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li> -1576 * </ul> -1577 * NOTE1: certissuer and certsubj is supported since asn1x509 1.0.10. -1578 * -1579 * Here is definition of the ASN.1 syntax: -1580 * <pre> -1581 * -- NOTE: under the CHOICE, it will always be explicit. -1582 * GeneralName ::= CHOICE { -1583 * otherName [0] OtherName, -1584 * rfc822Name [1] IA5String, -1585 * dNSName [2] IA5String, -1586 * x400Address [3] ORAddress, -1587 * directoryName [4] Name, -1588 * ediPartyName [5] EDIPartyName, -1589 * uniformResourceIdentifier [6] IA5String, -1590 * iPAddress [7] OCTET STRING, -1591 * registeredID [8] OBJECT IDENTIFIER } -1592 * </pre> -1593 * -1594 * -1595 * -1596 * @example -1597 * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'}); -1598 * gn = new KJUR.asn1.x509.GeneralName({dns: 'aaa.com'}); -1599 * gn = new KJUR.asn1.x509.GeneralName({uri: 'http://aaa.com/'}); -1600 * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM}); -1601 * gn = new KJUR.asn1.x509.GeneralName({certsubj: certPEM}); -1602 */ -1603 KJUR.asn1.x509.GeneralName = function(params) { -1604 KJUR.asn1.x509.GeneralName.superclass.constructor.call(this); -1605 var asn1Obj = null; -1606 var type = null; -1607 var pTag = {rfc822: '81', dns: '82', dn: 'a4', uri: '86'}; -1608 this.explicit = false; -1609 -1610 this.setByParam = function(params) { -1611 var str = null; -1612 var v = null; -1613 -1614 if (typeof params == "undefined") return; -1615 -1616 if (typeof params.rfc822 != "undefined") { -1617 this.type = 'rfc822'; -1618 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); -1619 } -1620 if (typeof params.dns != "undefined") { -1621 this.type = 'dns'; -1622 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); -1623 } -1624 if (typeof params.uri != "undefined") { -1625 this.type = 'uri'; -1626 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); -1627 } -1628 if (typeof params.certissuer != "undefined") { -1629 this.type = 'dn'; -1630 this.explicit = true; -1631 var certStr = params.certissuer; -1632 var certHex = null; -1633 if (certStr.match(/^[0-9A-Fa-f]+$/)) { -1634 certHex == certStr; -1635 } -1636 if (certStr.indexOf("-----BEGIN ") != -1) { -1637 certHex = X509.pemToHex(certStr); -1638 } -1639 if (certHex == null) throw "certissuer param not cert"; -1640 var x = new X509(); -1641 x.hex = certHex; -1642 var dnHex = x.getIssuerHex(); -1643 v = new KJUR.asn1.ASN1Object(); -1644 v.hTLV = dnHex; -1645 } -1646 if (typeof params.certsubj != "undefined") { -1647 this.type = 'dn'; -1648 this.explicit = true; -1649 var certStr = params.certsubj; -1650 var certHex = null; -1651 if (certStr.match(/^[0-9A-Fa-f]+$/)) { -1652 certHex == certStr; -1653 } -1654 if (certStr.indexOf("-----BEGIN ") != -1) { -1655 certHex = X509.pemToHex(certStr); -1656 } -1657 if (certHex == null) throw "certsubj param not cert"; -1658 var x = new X509(); -1659 x.hex = certHex; -1660 var dnHex = x.getSubjectHex(); -1661 v = new KJUR.asn1.ASN1Object(); -1662 v.hTLV = dnHex; -1663 } -1664 -1665 if (this.type == null) -1666 throw "unsupported type in params=" + params; -1667 this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': this.explicit, -1668 'tag': pTag[this.type], -1669 'obj': v}); -1670 }; -1671 -1672 this.getEncodedHex = function() { -1673 return this.asn1Obj.getEncodedHex(); -1674 } -1675 -1676 if (typeof params != "undefined") { -1677 this.setByParam(params); -1678 } -1679 -1680 }; -1681 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object); -1682 -1683 /** -1684 * GeneralNames ASN.1 structure class -1685 * @name KJUR.asn1.x509.GeneralNames -1686 * @class GeneralNames ASN.1 structure class -1687 * @description -1688 * <br/> -1689 * <h4>EXAMPLE AND ASN.1 SYNTAX</h4> -1690 * @example -1691 * var gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]); -1692 * -1693 * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName -1694 */ -1695 KJUR.asn1.x509.GeneralNames = function(paramsArray) { -1696 KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this); -1697 var asn1Array = null; -1698 -1699 /** -1700 * set a array of {@link KJUR.asn1.x509.GeneralName} parameters -1701 * @name setByParamArray -1702 * @memberOf KJUR.asn1.x509.GeneralNames -1703 * @function -1704 * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames} -1705 * @description -1706 * <br/> -1707 * <h4>EXAMPLES</h4> -1708 * @example -1709 * var gns = new KJUR.asn1.x509.GeneralNames(); -1710 * gns.setByParamArray([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]); -1711 */ -1712 this.setByParamArray = function(paramsArray) { -1713 for (var i = 0; i < paramsArray.length; i++) { -1714 var o = new KJUR.asn1.x509.GeneralName(paramsArray[i]); -1715 this.asn1Array.push(o); -1716 } -1717 }; -1718 -1719 this.getEncodedHex = function() { -1720 var o = new KJUR.asn1.DERSequence({'array': this.asn1Array}); -1721 return o.getEncodedHex(); -1722 }; -1723 -1724 this.asn1Array = new Array(); -1725 if (typeof paramsArray != "undefined") { -1726 this.setByParamArray(paramsArray); -1727 } -1728 }; -1729 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object); -1730 -1731 /** -1732 * DistributionPointName ASN.1 structure class -1733 * @name KJUR.asn1.x509.DistributionPointName -1734 * @class DistributionPointName ASN.1 structure class -1735 * @description -1736 * @example -1737 */ -1738 KJUR.asn1.x509.DistributionPointName = function(gnOrRdn) { -1739 KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this); -1740 var asn1Obj = null; -1741 var type = null; -1742 var tag = null; -1743 var asn1V = null; -1744 -1745 this.getEncodedHex = function() { -1746 if (this.type != "full") -1747 throw "currently type shall be 'full': " + this.type; -1748 this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': false, -1749 'tag': this.tag, -1750 'obj': this.asn1V}); -1751 this.hTLV = this.asn1Obj.getEncodedHex(); -1752 return this.hTLV; -1753 }; -1754 -1755 if (typeof gnOrRdn != "undefined") { -1756 if (KJUR.asn1.x509.GeneralNames.prototype.isPrototypeOf(gnOrRdn)) { -1757 this.type = "full"; -1758 this.tag = "a0"; -1759 this.asn1V = gnOrRdn; -1760 } else { -1761 throw "This class supports GeneralNames only as argument"; -1762 } -1763 } -1764 }; -1765 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object); -1766 -1767 /** -1768 * DistributionPoint ASN.1 structure class -1769 * @name KJUR.asn1.x509.DistributionPoint -1770 * @class DistributionPoint ASN.1 structure class -1771 * @description -1772 * @example -1773 */ -1774 KJUR.asn1.x509.DistributionPoint = function(params) { -1775 KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this); -1776 var asn1DP = null; -1777 -1778 this.getEncodedHex = function() { -1779 var seq = new KJUR.asn1.DERSequence(); -1780 if (this.asn1DP != null) { -1781 var o1 = new KJUR.asn1.DERTaggedObject({'explicit': true, -1782 'tag': 'a0', -1783 'obj': this.asn1DP}); -1784 seq.appendASN1Object(o1); -1785 } -1786 this.hTLV = seq.getEncodedHex(); -1787 return this.hTLV; -1788 }; -1789 -1790 if (typeof params != "undefined") { -1791 if (typeof params['dpobj'] != "undefined") { -1792 this.asn1DP = params['dpobj']; -1793 } -1794 } -1795 }; -1796 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object); -1797 -1798 /** -1799 * static object for OID -1800 * @name KJUR.asn1.x509.OID -1801 * @class static object for OID -1802 * @property {Assoc Array} atype2oidList for short attribyte type name and oid (i.e. 'C' and '2.5.4.6') -1803 * @property {Assoc Array} name2oidList for oid name and oid (i.e. 'keyUsage' and '2.5.29.15') -1804 * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object -1805 * @description -1806 * <dl> -1807 * <dt><b>atype2oidList</b> -1808 * <dd>currently supports 'C', 'O', 'OU', 'ST', 'L' and 'CN' only. -1809 * <dt><b>name2oidList</b> -1810 * <dd>currently supports 'SHA1withRSA', 'rsaEncryption' and some extension OIDs -1811 * </dl> -1812 * @example -1813 */ -1814 KJUR.asn1.x509.OID = new function(params) { -1815 this.atype2oidList = { -1816 'C': '2.5.4.6', -1817 'O': '2.5.4.10', -1818 'OU': '2.5.4.11', -1819 'ST': '2.5.4.8', -1820 'L': '2.5.4.7', -1821 'CN': '2.5.4.3', -1822 'SN': '2.5.4.4', -1823 'DN': '2.5.4.49', -1824 'DC': '0.9.2342.19200300.100.1.25', -1825 }; -1826 this.name2oidList = { -1827 'sha1': '1.3.14.3.2.26', -1828 'sha256': '2.16.840.1.101.3.4.2.1', -1829 'sha384': '2.16.840.1.101.3.4.2.2', -1830 'sha512': '2.16.840.1.101.3.4.2.3', -1831 'sha224': '2.16.840.1.101.3.4.2.4', -1832 'md5': '1.2.840.113549.2.5', -1833 'md2': '1.3.14.7.2.2.1', -1834 'ripemd160': '1.3.36.3.2.1', -1835 -1836 'MD2withRSA': '1.2.840.113549.1.1.2', -1837 'MD4withRSA': '1.2.840.113549.1.1.3', -1838 'MD5withRSA': '1.2.840.113549.1.1.4', -1839 'SHA1withRSA': '1.2.840.113549.1.1.5', -1840 'SHA224withRSA': '1.2.840.113549.1.1.14', -1841 'SHA256withRSA': '1.2.840.113549.1.1.11', -1842 'SHA384withRSA': '1.2.840.113549.1.1.12', -1843 'SHA512withRSA': '1.2.840.113549.1.1.13', -1844 -1845 'SHA1withECDSA': '1.2.840.10045.4.1', -1846 'SHA224withECDSA': '1.2.840.10045.4.3.1', -1847 'SHA256withECDSA': '1.2.840.10045.4.3.2', -1848 'SHA384withECDSA': '1.2.840.10045.4.3.3', -1849 'SHA512withECDSA': '1.2.840.10045.4.3.4', -1850 -1851 'dsa': '1.2.840.10040.4.1', -1852 'SHA1withDSA': '1.2.840.10040.4.3', -1853 'SHA224withDSA': '2.16.840.1.101.3.4.3.1', -1854 'SHA256withDSA': '2.16.840.1.101.3.4.3.2', -1855 -1856 'rsaEncryption': '1.2.840.113549.1.1.1', -1857 -1858 'countryName': '2.5.4.6', -1859 'organization': '2.5.4.10', -1860 'organizationalUnit': '2.5.4.11', -1861 'stateOrProvinceName': '2.5.4.8', -1862 'locality': '2.5.4.7', -1863 'commonName': '2.5.4.3', -1864 -1865 'subjectKeyIdentifier': '2.5.29.14', -1866 'keyUsage': '2.5.29.15', -1867 'subjectAltName': '2.5.29.17', -1868 'basicConstraints': '2.5.29.19', -1869 'nameConstraints': '2.5.29.30', -1870 'cRLDistributionPoints':'2.5.29.31', -1871 'certificatePolicies': '2.5.29.32', -1872 'authorityKeyIdentifier':'2.5.29.35', -1873 'policyConstraints': '2.5.29.36', -1874 'extKeyUsage': '2.5.29.37', -1875 'authorityInfoAccess': '1.3.6.1.5.5.7.1.1', -1876 -1877 'anyExtendedKeyUsage': '2.5.29.37.0', -1878 'serverAuth': '1.3.6.1.5.5.7.3.1', -1879 'clientAuth': '1.3.6.1.5.5.7.3.2', -1880 'codeSigning': '1.3.6.1.5.5.7.3.3', -1881 'emailProtection': '1.3.6.1.5.5.7.3.4', -1882 'timeStamping': '1.3.6.1.5.5.7.3.8', -1883 'ocspSigning': '1.3.6.1.5.5.7.3.9', -1884 -1885 'ecPublicKey': '1.2.840.10045.2.1', -1886 'secp256r1': '1.2.840.10045.3.1.7', -1887 'secp256k1': '1.3.132.0.10', -1888 'secp384r1': '1.3.132.0.34', -1889 -1890 'pkcs5PBES2': '1.2.840.113549.1.5.13', -1891 'pkcs5PBKDF2': '1.2.840.113549.1.5.12', -1892 -1893 'des-EDE3-CBC': '1.2.840.113549.3.7', -1894 -1895 'data': '1.2.840.113549.1.7.1', // CMS data -1896 'signed-data': '1.2.840.113549.1.7.2', // CMS signed-data -1897 'enveloped-data': '1.2.840.113549.1.7.3', // CMS enveloped-data -1898 'digested-data': '1.2.840.113549.1.7.5', // CMS digested-data -1899 'encrypted-data': '1.2.840.113549.1.7.6', // CMS encrypted-data -1900 'authenticated-data': '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data -1901 'tstinfo': '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo -1902 }; -1903 -1904 this.objCache = {}; -1905 -1906 /** -1907 * get DERObjectIdentifier by registered OID name -1908 * @name name2obj -1909 * @memberOf KJUR.asn1.x509.OID -1910 * @function -1911 * @param {String} name OID -1912 * @description -1913 * @example -1914 * var asn1ObjOID = OID.name2obj('SHA1withRSA'); -1915 */ -1916 this.name2obj = function(name) { -1917 if (typeof this.objCache[name] != "undefined") -1918 return this.objCache[name]; -1919 if (typeof this.name2oidList[name] == "undefined") -1920 throw "Name of ObjectIdentifier not defined: " + name; -1921 var oid = this.name2oidList[name]; -1922 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); -1923 this.objCache[name] = obj; -1924 return obj; -1925 }; -1926 -1927 /** -1928 * get DERObjectIdentifier by registered attribyte type name such like 'C' or 'CN' -1929 * @name atype2obj -1930 * @memberOf KJUR.asn1.x509.OID -1931 * @function -1932 * @param {String} atype short attribute type name such like 'C' or 'CN' -1933 * @description -1934 * @example -1935 * var asn1ObjOID = OID.atype2obj('CN'); -1936 */ -1937 this.atype2obj = function(atype) { -1938 if (typeof this.objCache[atype] != "undefined") -1939 return this.objCache[atype]; -1940 if (typeof this.atype2oidList[atype] == "undefined") -1941 throw "AttributeType name undefined: " + atype; -1942 var oid = this.atype2oidList[atype]; -1943 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); -1944 this.objCache[atype] = obj; -1945 return obj; -1946 }; -1947 }; -1948 -1949 /* -1950 * convert OID to name -1951 * @name oid2name -1952 * @memberOf KJUR.asn1.x509.OID -1953 * @function -1954 * @param {String} dot noted Object Identifer string (ex. 1.2.3.4) -1955 * @return {String} OID name -1956 * @description -1957 * This static method converts OID string to its name. -1958 * If OID is undefined then it returns empty string (i.e. ''). -1959 * @example -1960 * name = KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1"); -1961 * // name will be 'authorityInfoAccess'. -1962 * @since asn1x509 1.0.9 -1963 */ -1964 KJUR.asn1.x509.OID.oid2name = function(oid) { -1965 var list = KJUR.asn1.x509.OID.name2oidList; -1966 for (var name in list) { -1967 if (list[name] == oid) return name; -1968 } -1969 return ''; -1970 }; -1971 -1972 /* -1973 * convert name to OID -1974 * @name name2oid -1975 * @memberOf KJUR.asn1.x509.OID -1976 * @function -1977 * @param {String} OID name -1978 * @return {String} dot noted Object Identifer string (ex. 1.2.3.4) -1979 * @description -1980 * This static method converts from OID name to OID string. -1981 * If OID is undefined then it returns empty string (i.e. ''). -1982 * @example -1983 * name = KJUR.asn1.x509.OID.name2oid("authorityInfoAccess"); -1984 * // name will be '1.3.6.1.5.5.7.1.1'. -1985 * @since asn1x509 1.0.11 -1986 */ -1987 KJUR.asn1.x509.OID.name2oid = function(name) { -1988 var list = KJUR.asn1.x509.OID.name2oidList; -1989 if (list[name] === undefined) return ''; -1990 return list[name]; -1991 }; -1992 -1993 /** -1994 * X.509 certificate and CRL utilities class -1995 * @name KJUR.asn1.x509.X509Util -1996 * @class X.509 certificate and CRL utilities class -1997 */ -1998 KJUR.asn1.x509.X509Util = new function() { -1999 /** -2000 * get PKCS#8 PEM public key string from RSAKey object -2001 * @name getPKCS8PubKeyPEMfromRSAKey -2002 * @memberOf KJUR.asn1.x509.X509Util -2003 * @function -2004 * @param {RSAKey} rsaKey RSA public key of {@link RSAKey} object -2005 * @description -2006 * @example -2007 * var pem = KJUR.asn1.x509.X509Util.getPKCS8PubKeyPEMfromRSAKey(pubKey); -2008 */ -2009 this.getPKCS8PubKeyPEMfromRSAKey = function(rsaKey) { -2010 var pem = null; -2011 var hN = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(rsaKey.n); -2012 var hE = KJUR.asn1.ASN1Util.integerToByteHex(rsaKey.e); -2013 var iN = new KJUR.asn1.DERInteger({hex: hN}); -2014 var iE = new KJUR.asn1.DERInteger({hex: hE}); -2015 var asn1PubKey = new KJUR.asn1.DERSequence({array: [iN, iE]}); -2016 var hPubKey = asn1PubKey.getEncodedHex(); -2017 var o1 = new KJUR.asn1.x509.AlgorithmIdentifier({name: 'rsaEncryption'}); -2018 var o2 = new KJUR.asn1.DERBitString({hex: '00' + hPubKey}); -2019 var seq = new KJUR.asn1.DERSequence({array: [o1, o2]}); -2020 var hP8 = seq.getEncodedHex(); -2021 var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(hP8, "PUBLIC KEY"); -2022 return pem; -2023 }; -2024 }; -2025 /** -2026 * issue a certificate in PEM format -2027 * @name newCertPEM -2028 * @memberOf KJUR.asn1.x509.X509Util -2029 * @function -2030 * @param {Array} param parameter to issue a certificate -2031 * @since asn1x509 1.0.6 -2032 * @description -2033 * This method can issue a certificate by a simple -2034 * JSON object. -2035 * Signature value will be provided by signing with -2036 * private key using 'cakey' parameter or -2037 * hexa decimal signature value by 'sighex' parameter. -2038 * -2039 * NOTE: When using DSA or ECDSA CA signing key, -2040 * use 'paramempty' in 'sigalg' to ommit parameter field -2041 * of AlgorithmIdentifer. In case of RSA, parameter -2042 * NULL will be specified by default. -2043 * -2044 * @example -2045 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( -2046 * { serial: {int: 4}, -2047 * sigalg: {name: 'SHA1withECDSA', paramempty: true}, -2048 * issuer: {str: '/C=US/O=a'}, -2049 * notbefore: {'str': '130504235959Z'}, -2050 * notafter: {'str': '140504235959Z'}, -2051 * subject: {str: '/C=US/O=b'}, -2052 * sbjpubkey: pubKeyPEM, -2053 * ext: [ -2054 * {basicConstraints: {cA: true, critical: true}}, -2055 * {keyUsage: {bin: '11'}}, -2056 * ], -2057 * cakey: [prvkey, pass]} -2058 * ); -2059 * // -- or -- -2060 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( -2061 * { serial: {int: 1}, -2062 * sigalg: {name: 'SHA1withRSA', paramempty: true}, -2063 * issuer: {str: '/C=US/O=T1'}, -2064 * notbefore: {'str': '130504235959Z'}, -2065 * notafter: {'str': '140504235959Z'}, -2066 * subject: {str: '/C=US/O=T1'}, -2067 * sbjpubkey: pubKeyObj, -2068 * sighex: '0102030405..'} -2069 * ); -2070 * // for the issuer and subject field, another -2071 * // representation is also available -2072 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( -2073 * { serial: {int: 1}, -2074 * sigalg: {name: 'SHA1withRSA', paramempty: true}, -2075 * issuer: {C: "US", O: "T1"}, -2076 * notbefore: {'str': '130504235959Z'}, -2077 * notafter: {'str': '140504235959Z'}, -2078 * subject: {C: "US", O: "T1", CN: "http://example.com/"}, -2079 * sbjpubkey: pubKeyObj, -2080 * sighex: '0102030405..'} -2081 * ); -2082 */ -2083 KJUR.asn1.x509.X509Util.newCertPEM = function(param) { -2084 var ns1 = KJUR.asn1.x509; -2085 var o = new ns1.TBSCertificate(); -2086 -2087 if (param.serial !== undefined) -2088 o.setSerialNumberByParam(param.serial); -2089 else -2090 throw "serial number undefined."; -2091 -2092 if (typeof param.sigalg.name == 'string') -2093 o.setSignatureAlgByParam(param.sigalg); -2094 else -2095 throw "unproper signature algorithm name"; -2096 -2097 if (param.issuer !== undefined) -2098 o.setIssuerByParam(param.issuer); -2099 else -2100 throw "issuer name undefined."; -2101 -2102 if (param.notbefore !== undefined) -2103 o.setNotBeforeByParam(param.notbefore); -2104 else -2105 throw "notbefore undefined."; -2106 -2107 if (param.notafter !== undefined) -2108 o.setNotAfterByParam(param.notafter); -2109 else -2110 throw "notafter undefined."; -2111 -2112 if (param.subject !== undefined) -2113 o.setSubjectByParam(param.subject); -2114 else -2115 throw "subject name undefined."; -2116 -2117 if (param.sbjpubkey !== undefined) -2118 o.setSubjectPublicKeyByGetKey(param.sbjpubkey); -2119 else -2120 throw "subject public key undefined."; -2121 -2122 if (param.ext !== undefined && param.ext.length !== undefined) { -2123 for (var i = 0; i < param.ext.length; i++) { -2124 for (key in param.ext[i]) { -2125 o.appendExtensionByName(key, param.ext[i][key]); -2126 } -2127 } -2128 } -2129 -2130 // set signature -2131 if (param.cakey === undefined && param.sighex === undefined) -2132 throw "param cakey and sighex undefined."; -2133 -2134 var caKey = null; -2135 var cert = null; -2136 -2137 if (param.cakey) { -2138 caKey = KEYUTIL.getKey.apply(null, param.cakey); -2139 cert = new ns1.Certificate({'tbscertobj': o, 'prvkeyobj': caKey}); -2140 cert.sign(); -2141 } -2142 -2143 if (param.sighex) { -2144 cert = new ns1.Certificate({'tbscertobj': o}); -2145 cert.setSignatureHex(param.sighex); -2146 } -2147 -2148 return cert.getPEMString(); -2149 }; -2150 -2151 /* -2152 org.bouncycastle.asn1.x500 -2153 AttributeTypeAndValue -2154 DirectoryString -2155 RDN -2156 X500Name -2157 X500NameBuilder -2158 -2159 org.bouncycastleasn1.x509 -2160 TBSCertificate -2161 */ -2162 \ No newline at end of file +1523 * algId1 = new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"}); +1524 */ +1525 KJUR.asn1.x509.AlgorithmIdentifier = function(params) { +1526 KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this); +1527 var nameAlg = null; +1528 var asn1Alg = null; +1529 var asn1Params = null; +1530 var paramEmpty = false; +1531 +1532 this.getEncodedHex = function() { +1533 if (this.nameAlg == null && this.asn1Alg == null) { +1534 throw "algorithm not specified"; +1535 } +1536 if (this.nameAlg != null && this.asn1Alg == null) { +1537 this.asn1Alg = KJUR.asn1.x509.OID.name2obj(this.nameAlg); +1538 } +1539 var a = [this.asn1Alg]; +1540 if (! this.paramEmpty) a.push(this.asn1Params); +1541 var o = new KJUR.asn1.DERSequence({'array': a}); +1542 this.hTLV = o.getEncodedHex(); +1543 return this.hTLV; +1544 }; +1545 +1546 if (typeof params != "undefined") { +1547 if (typeof params['name'] != "undefined") { +1548 this.nameAlg = params['name']; +1549 } +1550 if (typeof params['asn1params'] != "undefined") { +1551 this.asn1Params = params['asn1params']; +1552 } +1553 if (typeof params['paramempty'] != "undefined") { +1554 this.paramEmpty = params['paramempty']; +1555 } +1556 } +1557 if (this.asn1Params == null) { +1558 this.asn1Params = new KJUR.asn1.DERNull(); +1559 } +1560 }; +1561 YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier, KJUR.asn1.ASN1Object); +1562 +1563 /** +1564 * GeneralName ASN.1 structure class +1565 * @name KJUR.asn1.x509.GeneralName +1566 * @class GeneralName ASN.1 structure class +1567 * @description +1568 * <br/> +1569 * As for argument 'params' for constructor, you can specify one of +1570 * following properties: +1571 * <ul> +1572 * <li>rfc822 - rfc822Name[1] (ex. user1@foo.com)</li> +1573 * <li>dns - dNSName[2] (ex. foo.com)</li> +1574 * <li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)</li> +1575 * <li>certissuer - directoryName[4] (PEM or hex string of cert)</li> +1576 * <li>certsubj - directoryName[4] (PEM or hex string of cert)</li> +1577 * </ul> +1578 * NOTE1: certissuer and certsubj is supported since asn1x509 1.0.10. +1579 * +1580 * Here is definition of the ASN.1 syntax: +1581 * <pre> +1582 * -- NOTE: under the CHOICE, it will always be explicit. +1583 * GeneralName ::= CHOICE { +1584 * otherName [0] OtherName, +1585 * rfc822Name [1] IA5String, +1586 * dNSName [2] IA5String, +1587 * x400Address [3] ORAddress, +1588 * directoryName [4] Name, +1589 * ediPartyName [5] EDIPartyName, +1590 * uniformResourceIdentifier [6] IA5String, +1591 * iPAddress [7] OCTET STRING, +1592 * registeredID [8] OBJECT IDENTIFIER } +1593 * </pre> +1594 * +1595 * +1596 * +1597 * @example +1598 * gn = new KJUR.asn1.x509.GeneralName({rfc822: 'test@aaa.com'}); +1599 * gn = new KJUR.asn1.x509.GeneralName({dns: 'aaa.com'}); +1600 * gn = new KJUR.asn1.x509.GeneralName({uri: 'http://aaa.com/'}); +1601 * gn = new KJUR.asn1.x509.GeneralName({certissuer: certPEM}); +1602 * gn = new KJUR.asn1.x509.GeneralName({certsubj: certPEM}); +1603 */ +1604 KJUR.asn1.x509.GeneralName = function(params) { +1605 KJUR.asn1.x509.GeneralName.superclass.constructor.call(this); +1606 var asn1Obj = null; +1607 var type = null; +1608 var pTag = {rfc822: '81', dns: '82', dn: 'a4', uri: '86'}; +1609 this.explicit = false; +1610 +1611 this.setByParam = function(params) { +1612 var str = null; +1613 var v = null; +1614 +1615 if (typeof params == "undefined") return; +1616 +1617 if (typeof params.rfc822 != "undefined") { +1618 this.type = 'rfc822'; +1619 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); +1620 } +1621 if (typeof params.dns != "undefined") { +1622 this.type = 'dns'; +1623 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); +1624 } +1625 if (typeof params.uri != "undefined") { +1626 this.type = 'uri'; +1627 v = new KJUR.asn1.DERIA5String({'str': params[this.type]}); +1628 } +1629 if (typeof params.certissuer != "undefined") { +1630 this.type = 'dn'; +1631 this.explicit = true; +1632 var certStr = params.certissuer; +1633 var certHex = null; +1634 if (certStr.match(/^[0-9A-Fa-f]+$/)) { +1635 certHex == certStr; +1636 } +1637 if (certStr.indexOf("-----BEGIN ") != -1) { +1638 certHex = X509.pemToHex(certStr); +1639 } +1640 if (certHex == null) throw "certissuer param not cert"; +1641 var x = new X509(); +1642 x.hex = certHex; +1643 var dnHex = x.getIssuerHex(); +1644 v = new KJUR.asn1.ASN1Object(); +1645 v.hTLV = dnHex; +1646 } +1647 if (typeof params.certsubj != "undefined") { +1648 this.type = 'dn'; +1649 this.explicit = true; +1650 var certStr = params.certsubj; +1651 var certHex = null; +1652 if (certStr.match(/^[0-9A-Fa-f]+$/)) { +1653 certHex == certStr; +1654 } +1655 if (certStr.indexOf("-----BEGIN ") != -1) { +1656 certHex = X509.pemToHex(certStr); +1657 } +1658 if (certHex == null) throw "certsubj param not cert"; +1659 var x = new X509(); +1660 x.hex = certHex; +1661 var dnHex = x.getSubjectHex(); +1662 v = new KJUR.asn1.ASN1Object(); +1663 v.hTLV = dnHex; +1664 } +1665 +1666 if (this.type == null) +1667 throw "unsupported type in params=" + params; +1668 this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': this.explicit, +1669 'tag': pTag[this.type], +1670 'obj': v}); +1671 }; +1672 +1673 this.getEncodedHex = function() { +1674 return this.asn1Obj.getEncodedHex(); +1675 } +1676 +1677 if (typeof params != "undefined") { +1678 this.setByParam(params); +1679 } +1680 +1681 }; +1682 YAHOO.lang.extend(KJUR.asn1.x509.GeneralName, KJUR.asn1.ASN1Object); +1683 +1684 /** +1685 * GeneralNames ASN.1 structure class +1686 * @name KJUR.asn1.x509.GeneralNames +1687 * @class GeneralNames ASN.1 structure class +1688 * @description +1689 * <br/> +1690 * <h4>EXAMPLE AND ASN.1 SYNTAX</h4> +1691 * @example +1692 * var gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]); +1693 * +1694 * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName +1695 */ +1696 KJUR.asn1.x509.GeneralNames = function(paramsArray) { +1697 KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this); +1698 var asn1Array = null; +1699 +1700 /** +1701 * set a array of {@link KJUR.asn1.x509.GeneralName} parameters +1702 * @name setByParamArray +1703 * @memberOf KJUR.asn1.x509.GeneralNames +1704 * @function +1705 * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames} +1706 * @description +1707 * <br/> +1708 * <h4>EXAMPLES</h4> +1709 * @example +1710 * var gns = new KJUR.asn1.x509.GeneralNames(); +1711 * gns.setByParamArray([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]); +1712 */ +1713 this.setByParamArray = function(paramsArray) { +1714 for (var i = 0; i < paramsArray.length; i++) { +1715 var o = new KJUR.asn1.x509.GeneralName(paramsArray[i]); +1716 this.asn1Array.push(o); +1717 } +1718 }; +1719 +1720 this.getEncodedHex = function() { +1721 var o = new KJUR.asn1.DERSequence({'array': this.asn1Array}); +1722 return o.getEncodedHex(); +1723 }; +1724 +1725 this.asn1Array = new Array(); +1726 if (typeof paramsArray != "undefined") { +1727 this.setByParamArray(paramsArray); +1728 } +1729 }; +1730 YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames, KJUR.asn1.ASN1Object); +1731 +1732 /** +1733 * DistributionPointName ASN.1 structure class +1734 * @name KJUR.asn1.x509.DistributionPointName +1735 * @class DistributionPointName ASN.1 structure class +1736 * @description +1737 * @example +1738 */ +1739 KJUR.asn1.x509.DistributionPointName = function(gnOrRdn) { +1740 KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this); +1741 var asn1Obj = null; +1742 var type = null; +1743 var tag = null; +1744 var asn1V = null; +1745 +1746 this.getEncodedHex = function() { +1747 if (this.type != "full") +1748 throw "currently type shall be 'full': " + this.type; +1749 this.asn1Obj = new KJUR.asn1.DERTaggedObject({'explicit': false, +1750 'tag': this.tag, +1751 'obj': this.asn1V}); +1752 this.hTLV = this.asn1Obj.getEncodedHex(); +1753 return this.hTLV; +1754 }; +1755 +1756 if (typeof gnOrRdn != "undefined") { +1757 if (KJUR.asn1.x509.GeneralNames.prototype.isPrototypeOf(gnOrRdn)) { +1758 this.type = "full"; +1759 this.tag = "a0"; +1760 this.asn1V = gnOrRdn; +1761 } else { +1762 throw "This class supports GeneralNames only as argument"; +1763 } +1764 } +1765 }; +1766 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName, KJUR.asn1.ASN1Object); +1767 +1768 /** +1769 * DistributionPoint ASN.1 structure class +1770 * @name KJUR.asn1.x509.DistributionPoint +1771 * @class DistributionPoint ASN.1 structure class +1772 * @description +1773 * @example +1774 */ +1775 KJUR.asn1.x509.DistributionPoint = function(params) { +1776 KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this); +1777 var asn1DP = null; +1778 +1779 this.getEncodedHex = function() { +1780 var seq = new KJUR.asn1.DERSequence(); +1781 if (this.asn1DP != null) { +1782 var o1 = new KJUR.asn1.DERTaggedObject({'explicit': true, +1783 'tag': 'a0', +1784 'obj': this.asn1DP}); +1785 seq.appendASN1Object(o1); +1786 } +1787 this.hTLV = seq.getEncodedHex(); +1788 return this.hTLV; +1789 }; +1790 +1791 if (typeof params != "undefined") { +1792 if (typeof params['dpobj'] != "undefined") { +1793 this.asn1DP = params['dpobj']; +1794 } +1795 } +1796 }; +1797 YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint, KJUR.asn1.ASN1Object); +1798 +1799 /** +1800 * static object for OID +1801 * @name KJUR.asn1.x509.OID +1802 * @class static object for OID +1803 * @property {Assoc Array} atype2oidList for short attribyte type name and oid (i.e. 'C' and '2.5.4.6') +1804 * @property {Assoc Array} name2oidList for oid name and oid (i.e. 'keyUsage' and '2.5.29.15') +1805 * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object +1806 * @description +1807 * <dl> +1808 * <dt><b>atype2oidList</b> +1809 * <dd>currently supports 'C', 'O', 'OU', 'ST', 'L' and 'CN' only. +1810 * <dt><b>name2oidList</b> +1811 * <dd>currently supports 'SHA1withRSA', 'rsaEncryption' and some extension OIDs +1812 * </dl> +1813 * @example +1814 */ +1815 KJUR.asn1.x509.OID = new function(params) { +1816 this.atype2oidList = { +1817 'C': '2.5.4.6', +1818 'O': '2.5.4.10', +1819 'OU': '2.5.4.11', +1820 'ST': '2.5.4.8', +1821 'L': '2.5.4.7', +1822 'CN': '2.5.4.3', +1823 'SN': '2.5.4.4', +1824 'DN': '2.5.4.49', +1825 'DC': '0.9.2342.19200300.100.1.25', +1826 }; +1827 this.name2oidList = { +1828 'sha1': '1.3.14.3.2.26', +1829 'sha256': '2.16.840.1.101.3.4.2.1', +1830 'sha384': '2.16.840.1.101.3.4.2.2', +1831 'sha512': '2.16.840.1.101.3.4.2.3', +1832 'sha224': '2.16.840.1.101.3.4.2.4', +1833 'md5': '1.2.840.113549.2.5', +1834 'md2': '1.3.14.7.2.2.1', +1835 'ripemd160': '1.3.36.3.2.1', +1836 +1837 'MD2withRSA': '1.2.840.113549.1.1.2', +1838 'MD4withRSA': '1.2.840.113549.1.1.3', +1839 'MD5withRSA': '1.2.840.113549.1.1.4', +1840 'SHA1withRSA': '1.2.840.113549.1.1.5', +1841 'SHA224withRSA': '1.2.840.113549.1.1.14', +1842 'SHA256withRSA': '1.2.840.113549.1.1.11', +1843 'SHA384withRSA': '1.2.840.113549.1.1.12', +1844 'SHA512withRSA': '1.2.840.113549.1.1.13', +1845 +1846 'SHA1withECDSA': '1.2.840.10045.4.1', +1847 'SHA224withECDSA': '1.2.840.10045.4.3.1', +1848 'SHA256withECDSA': '1.2.840.10045.4.3.2', +1849 'SHA384withECDSA': '1.2.840.10045.4.3.3', +1850 'SHA512withECDSA': '1.2.840.10045.4.3.4', +1851 +1852 'dsa': '1.2.840.10040.4.1', +1853 'SHA1withDSA': '1.2.840.10040.4.3', +1854 'SHA224withDSA': '2.16.840.1.101.3.4.3.1', +1855 'SHA256withDSA': '2.16.840.1.101.3.4.3.2', +1856 +1857 'rsaEncryption': '1.2.840.113549.1.1.1', +1858 +1859 'countryName': '2.5.4.6', +1860 'organization': '2.5.4.10', +1861 'organizationalUnit': '2.5.4.11', +1862 'stateOrProvinceName': '2.5.4.8', +1863 'locality': '2.5.4.7', +1864 'commonName': '2.5.4.3', +1865 +1866 'subjectKeyIdentifier': '2.5.29.14', +1867 'keyUsage': '2.5.29.15', +1868 'subjectAltName': '2.5.29.17', +1869 'basicConstraints': '2.5.29.19', +1870 'nameConstraints': '2.5.29.30', +1871 'cRLDistributionPoints':'2.5.29.31', +1872 'certificatePolicies': '2.5.29.32', +1873 'authorityKeyIdentifier':'2.5.29.35', +1874 'policyConstraints': '2.5.29.36', +1875 'extKeyUsage': '2.5.29.37', +1876 'authorityInfoAccess': '1.3.6.1.5.5.7.1.1', +1877 +1878 'anyExtendedKeyUsage': '2.5.29.37.0', +1879 'serverAuth': '1.3.6.1.5.5.7.3.1', +1880 'clientAuth': '1.3.6.1.5.5.7.3.2', +1881 'codeSigning': '1.3.6.1.5.5.7.3.3', +1882 'emailProtection': '1.3.6.1.5.5.7.3.4', +1883 'timeStamping': '1.3.6.1.5.5.7.3.8', +1884 'ocspSigning': '1.3.6.1.5.5.7.3.9', +1885 +1886 'ecPublicKey': '1.2.840.10045.2.1', +1887 'secp256r1': '1.2.840.10045.3.1.7', +1888 'secp256k1': '1.3.132.0.10', +1889 'secp384r1': '1.3.132.0.34', +1890 +1891 'pkcs5PBES2': '1.2.840.113549.1.5.13', +1892 'pkcs5PBKDF2': '1.2.840.113549.1.5.12', +1893 +1894 'des-EDE3-CBC': '1.2.840.113549.3.7', +1895 +1896 'data': '1.2.840.113549.1.7.1', // CMS data +1897 'signed-data': '1.2.840.113549.1.7.2', // CMS signed-data +1898 'enveloped-data': '1.2.840.113549.1.7.3', // CMS enveloped-data +1899 'digested-data': '1.2.840.113549.1.7.5', // CMS digested-data +1900 'encrypted-data': '1.2.840.113549.1.7.6', // CMS encrypted-data +1901 'authenticated-data': '1.2.840.113549.1.9.16.1.2', // CMS authenticated-data +1902 'tstinfo': '1.2.840.113549.1.9.16.1.4', // RFC3161 TSTInfo +1903 }; +1904 +1905 this.objCache = {}; +1906 +1907 /** +1908 * get DERObjectIdentifier by registered OID name +1909 * @name name2obj +1910 * @memberOf KJUR.asn1.x509.OID +1911 * @function +1912 * @param {String} name OID +1913 * @description +1914 * @example +1915 * var asn1ObjOID = OID.name2obj('SHA1withRSA'); +1916 */ +1917 this.name2obj = function(name) { +1918 if (typeof this.objCache[name] != "undefined") +1919 return this.objCache[name]; +1920 if (typeof this.name2oidList[name] == "undefined") +1921 throw "Name of ObjectIdentifier not defined: " + name; +1922 var oid = this.name2oidList[name]; +1923 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); +1924 this.objCache[name] = obj; +1925 return obj; +1926 }; +1927 +1928 /** +1929 * get DERObjectIdentifier by registered attribyte type name such like 'C' or 'CN' +1930 * @name atype2obj +1931 * @memberOf KJUR.asn1.x509.OID +1932 * @function +1933 * @param {String} atype short attribute type name such like 'C' or 'CN' +1934 * @description +1935 * @example +1936 * var asn1ObjOID = OID.atype2obj('CN'); +1937 */ +1938 this.atype2obj = function(atype) { +1939 if (typeof this.objCache[atype] != "undefined") +1940 return this.objCache[atype]; +1941 if (typeof this.atype2oidList[atype] == "undefined") +1942 throw "AttributeType name undefined: " + atype; +1943 var oid = this.atype2oidList[atype]; +1944 var obj = new KJUR.asn1.DERObjectIdentifier({'oid': oid}); +1945 this.objCache[atype] = obj; +1946 return obj; +1947 }; +1948 }; +1949 +1950 /* +1951 * convert OID to name +1952 * @name oid2name +1953 * @memberOf KJUR.asn1.x509.OID +1954 * @function +1955 * @param {String} dot noted Object Identifer string (ex. 1.2.3.4) +1956 * @return {String} OID name +1957 * @description +1958 * This static method converts OID string to its name. +1959 * If OID is undefined then it returns empty string (i.e. ''). +1960 * @example +1961 * name = KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1"); +1962 * // name will be 'authorityInfoAccess'. +1963 * @since asn1x509 1.0.9 +1964 */ +1965 KJUR.asn1.x509.OID.oid2name = function(oid) { +1966 var list = KJUR.asn1.x509.OID.name2oidList; +1967 for (var name in list) { +1968 if (list[name] == oid) return name; +1969 } +1970 return ''; +1971 }; +1972 +1973 /* +1974 * convert name to OID +1975 * @name name2oid +1976 * @memberOf KJUR.asn1.x509.OID +1977 * @function +1978 * @param {String} OID name +1979 * @return {String} dot noted Object Identifer string (ex. 1.2.3.4) +1980 * @description +1981 * This static method converts from OID name to OID string. +1982 * If OID is undefined then it returns empty string (i.e. ''). +1983 * @example +1984 * name = KJUR.asn1.x509.OID.name2oid("authorityInfoAccess"); +1985 * // name will be '1.3.6.1.5.5.7.1.1'. +1986 * @since asn1x509 1.0.11 +1987 */ +1988 KJUR.asn1.x509.OID.name2oid = function(name) { +1989 var list = KJUR.asn1.x509.OID.name2oidList; +1990 if (list[name] === undefined) return ''; +1991 return list[name]; +1992 }; +1993 +1994 /** +1995 * X.509 certificate and CRL utilities class +1996 * @name KJUR.asn1.x509.X509Util +1997 * @class X.509 certificate and CRL utilities class +1998 */ +1999 KJUR.asn1.x509.X509Util = new function() { +2000 /** +2001 * get PKCS#8 PEM public key string from RSAKey object +2002 * @name getPKCS8PubKeyPEMfromRSAKey +2003 * @memberOf KJUR.asn1.x509.X509Util +2004 * @function +2005 * @param {RSAKey} rsaKey RSA public key of {@link RSAKey} object +2006 * @description +2007 * @example +2008 * var pem = KJUR.asn1.x509.X509Util.getPKCS8PubKeyPEMfromRSAKey(pubKey); +2009 */ +2010 this.getPKCS8PubKeyPEMfromRSAKey = function(rsaKey) { +2011 var pem = null; +2012 var hN = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(rsaKey.n); +2013 var hE = KJUR.asn1.ASN1Util.integerToByteHex(rsaKey.e); +2014 var iN = new KJUR.asn1.DERInteger({hex: hN}); +2015 var iE = new KJUR.asn1.DERInteger({hex: hE}); +2016 var asn1PubKey = new KJUR.asn1.DERSequence({array: [iN, iE]}); +2017 var hPubKey = asn1PubKey.getEncodedHex(); +2018 var o1 = new KJUR.asn1.x509.AlgorithmIdentifier({name: 'rsaEncryption'}); +2019 var o2 = new KJUR.asn1.DERBitString({hex: '00' + hPubKey}); +2020 var seq = new KJUR.asn1.DERSequence({array: [o1, o2]}); +2021 var hP8 = seq.getEncodedHex(); +2022 var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(hP8, "PUBLIC KEY"); +2023 return pem; +2024 }; +2025 }; +2026 /** +2027 * issue a certificate in PEM format +2028 * @name newCertPEM +2029 * @memberOf KJUR.asn1.x509.X509Util +2030 * @function +2031 * @param {Array} param parameter to issue a certificate +2032 * @since asn1x509 1.0.6 +2033 * @description +2034 * This method can issue a certificate by a simple +2035 * JSON object. +2036 * Signature value will be provided by signing with +2037 * private key using 'cakey' parameter or +2038 * hexa decimal signature value by 'sighex' parameter. +2039 * +2040 * NOTE: When using DSA or ECDSA CA signing key, +2041 * use 'paramempty' in 'sigalg' to ommit parameter field +2042 * of AlgorithmIdentifer. In case of RSA, parameter +2043 * NULL will be specified by default. +2044 * +2045 * @example +2046 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( +2047 * { serial: {int: 4}, +2048 * sigalg: {name: 'SHA1withECDSA', paramempty: true}, +2049 * issuer: {str: '/C=US/O=a'}, +2050 * notbefore: {'str': '130504235959Z'}, +2051 * notafter: {'str': '140504235959Z'}, +2052 * subject: {str: '/C=US/O=b'}, +2053 * sbjpubkey: pubKeyPEM, +2054 * ext: [ +2055 * {basicConstraints: {cA: true, critical: true}}, +2056 * {keyUsage: {bin: '11'}}, +2057 * ], +2058 * cakey: [prvkey, pass]} +2059 * ); +2060 * // -- or -- +2061 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( +2062 * { serial: {int: 1}, +2063 * sigalg: {name: 'SHA1withRSA', paramempty: true}, +2064 * issuer: {str: '/C=US/O=T1'}, +2065 * notbefore: {'str': '130504235959Z'}, +2066 * notafter: {'str': '140504235959Z'}, +2067 * subject: {str: '/C=US/O=T1'}, +2068 * sbjpubkey: pubKeyObj, +2069 * sighex: '0102030405..'} +2070 * ); +2071 * // for the issuer and subject field, another +2072 * // representation is also available +2073 * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM( +2074 * { serial: {int: 1}, +2075 * sigalg: {name: 'SHA1withRSA', paramempty: true}, +2076 * issuer: {C: "US", O: "T1"}, +2077 * notbefore: {'str': '130504235959Z'}, +2078 * notafter: {'str': '140504235959Z'}, +2079 * subject: {C: "US", O: "T1", CN: "http://example.com/"}, +2080 * sbjpubkey: pubKeyObj, +2081 * sighex: '0102030405..'} +2082 * ); +2083 */ +2084 KJUR.asn1.x509.X509Util.newCertPEM = function(param) { +2085 var ns1 = KJUR.asn1.x509; +2086 var o = new ns1.TBSCertificate(); +2087 +2088 if (param.serial !== undefined) +2089 o.setSerialNumberByParam(param.serial); +2090 else +2091 throw "serial number undefined."; +2092 +2093 if (typeof param.sigalg.name == 'string') +2094 o.setSignatureAlgByParam(param.sigalg); +2095 else +2096 throw "unproper signature algorithm name"; +2097 +2098 if (param.issuer !== undefined) +2099 o.setIssuerByParam(param.issuer); +2100 else +2101 throw "issuer name undefined."; +2102 +2103 if (param.notbefore !== undefined) +2104 o.setNotBeforeByParam(param.notbefore); +2105 else +2106 throw "notbefore undefined."; +2107 +2108 if (param.notafter !== undefined) +2109 o.setNotAfterByParam(param.notafter); +2110 else +2111 throw "notafter undefined."; +2112 +2113 if (param.subject !== undefined) +2114 o.setSubjectByParam(param.subject); +2115 else +2116 throw "subject name undefined."; +2117 +2118 if (param.sbjpubkey !== undefined) +2119 o.setSubjectPublicKeyByGetKey(param.sbjpubkey); +2120 else +2121 throw "subject public key undefined."; +2122 +2123 if (param.ext !== undefined && param.ext.length !== undefined) { +2124 for (var i = 0; i < param.ext.length; i++) { +2125 for (key in param.ext[i]) { +2126 o.appendExtensionByName(key, param.ext[i][key]); +2127 } +2128 } +2129 } +2130 +2131 // set signature +2132 if (param.cakey === undefined && param.sighex === undefined) +2133 throw "param cakey and sighex undefined."; +2134 +2135 var caKey = null; +2136 var cert = null; +2137 +2138 if (param.cakey) { +2139 caKey = KEYUTIL.getKey.apply(null, param.cakey); +2140 cert = new ns1.Certificate({'tbscertobj': o, 'prvkeyobj': caKey}); +2141 cert.sign(); +2142 } +2143 +2144 if (param.sighex) { +2145 cert = new ns1.Certificate({'tbscertobj': o}); +2146 cert.setSignatureHex(param.sighex); +2147 } +2148 +2149 return cert.getPEMString(); +2150 }; +2151 +2152 /* +2153 org.bouncycastle.asn1.x500 +2154 AttributeTypeAndValue +2155 DirectoryString +2156 RDN +2157 X500Name +2158 X500NameBuilder +2159 +2160 org.bouncycastleasn1.x509 +2161 TBSCertificate +2162 */ +2163 \ No newline at end of file diff --git a/api/symbols/src/x509-1.1.js.html b/api/symbols/src/x509-1.1.js.html index d46898d1..97210b1c 100644 --- a/api/symbols/src/x509-1.1.js.html +++ b/api/symbols/src/x509-1.1.js.html @@ -415,828 +415,850 @@ 408 return hCert; 409 }; 410 -411 // NOTE: Without BITSTRING encapsulation. -412 X509.getSubjectPublicKeyPosFromCertHex = function(hCert) { -413 var pInfo = X509.getSubjectPublicKeyInfoPosFromCertHex(hCert); -414 if (pInfo == -1) return -1; -415 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pInfo); -416 if (a.length != 2) return -1; -417 var pBitString = a[1]; -418 if (hCert.substring(pBitString, pBitString + 2) != '03') return -1; -419 var pBitStringV = ASN1HEX.getStartPosOfV_AtObj(hCert, pBitString); -420 -421 if (hCert.substring(pBitStringV, pBitStringV + 2) != '00') return -1; -422 return pBitStringV + 2; -423 }; -424 -425 // NOTE: privateKeyUsagePeriod field of X509v2 not supported. -426 // NOTE: v1 and v3 supported -427 X509.getSubjectPublicKeyInfoPosFromCertHex = function(hCert) { -428 var pTbsCert = ASN1HEX.getStartPosOfV_AtObj(hCert, 0); -429 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pTbsCert); -430 if (a.length < 1) return -1; -431 if (hCert.substring(a[0], a[0] + 10) == "a003020102") { // v3 -432 if (a.length < 6) return -1; -433 return a[6]; -434 } else { -435 if (a.length < 5) return -1; -436 return a[5]; -437 } -438 }; -439 -440 X509.getPublicKeyHexArrayFromCertHex = function(hCert) { -441 var p = X509.getSubjectPublicKeyPosFromCertHex(hCert); -442 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, p); -443 if (a.length != 2) return []; -444 var hN = ASN1HEX.getHexOfV_AtObj(hCert, a[0]); -445 var hE = ASN1HEX.getHexOfV_AtObj(hCert, a[1]); -446 if (hN != null && hE != null) { -447 return [hN, hE]; -448 } else { -449 return []; -450 } -451 }; -452 -453 X509.getHexTbsCertificateFromCert = function(hCert) { -454 var pTbsCert = ASN1HEX.getStartPosOfV_AtObj(hCert, 0); -455 return pTbsCert; -456 }; -457 -458 X509.getPublicKeyHexArrayFromCertPEM = function(sCertPEM) { -459 var hCert = X509.pemToHex(sCertPEM); -460 var a = X509.getPublicKeyHexArrayFromCertHex(hCert); -461 return a; -462 }; -463 -464 X509.hex2dn = function(hDN) { -465 var s = ""; -466 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0); -467 for (var i = 0; i < a.length; i++) { -468 var hRDN = ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]); -469 s = s + "/" + X509.hex2rdn(hRDN); -470 } -471 return s; -472 }; -473 -474 X509.hex2rdn = function(hRDN) { -475 var hType = ASN1HEX.getDecendantHexTLVByNthList(hRDN, 0, [0, 0]); -476 var hValue = ASN1HEX.getDecendantHexVByNthList(hRDN, 0, [0, 1]); -477 var type = ""; -478 try { type = X509.DN_ATTRHEX[hType]; } catch (ex) { type = hType; } -479 hValue = hValue.replace(/(..)/g, "%$1"); -480 var value = decodeURIComponent(hValue); -481 return type + "=" + value; -482 }; -483 -484 X509.DN_ATTRHEX = { -485 "0603550406": "C", -486 "060355040a": "O", -487 "060355040b": "OU", -488 "0603550403": "CN", -489 "0603550405": "SN", -490 "0603550408": "ST", -491 "0603550407": "L", -492 "0603550409": "streetAddress", -493 "060355040f": "businessCategory", -494 "0603550411": "postalCode", -495 "060b2b0601040182373c020102": "jurisdictionOfIncorporationSP", -496 "060b2b0601040182373c020103": "jurisdictionOfIncorporationC", -497 }; -498 -499 /** -500 * get RSAKey/ECDSA public key object from PEM certificate string -501 * @name getPublicKeyFromCertPEM -502 * @memberOf X509 -503 * @function -504 * @param {String} sCertPEM PEM formatted RSA/ECDSA/DSA X.509 certificate -505 * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key -506 * @since x509 1.1.1 -507 * @description -508 * NOTE: DSA is also supported since x509 1.1.2. -509 */ -510 X509.getPublicKeyFromCertPEM = function(sCertPEM) { -511 var info = X509.getPublicKeyInfoPropOfCertPEM(sCertPEM); -512 -513 if (info.algoid == "2a864886f70d010101") { // RSA -514 var aRSA = KEYUTIL.parsePublicRawRSAKeyHex(info.keyhex); -515 var key = new RSAKey(); -516 key.setPublic(aRSA.n, aRSA.e); -517 return key; -518 } else if (info.algoid == "2a8648ce3d0201") { // ECC -519 var curveName = KJUR.crypto.OID.oidhex2name[info.algparam]; -520 var key = new KJUR.crypto.ECDSA({'curve': curveName, 'info': info.keyhex}); -521 key.setPublicKeyHex(info.keyhex); -522 return key; -523 } else if (info.algoid == "2a8648ce380401") { // DSA 1.2.840.10040.4.1 -524 var p = ASN1HEX.getVbyList(info.algparam, 0, [0], "02"); -525 var q = ASN1HEX.getVbyList(info.algparam, 0, [1], "02"); -526 var g = ASN1HEX.getVbyList(info.algparam, 0, [2], "02"); -527 var y = ASN1HEX.getHexOfV_AtObj(info.keyhex, 0); -528 y = y.substr(2); -529 var key = new KJUR.crypto.DSA(); -530 key.setPublic(new BigInteger(p, 16), -531 new BigInteger(q, 16), -532 new BigInteger(g, 16), -533 new BigInteger(y, 16)); -534 return key; -535 } else { -536 throw "unsupported key"; -537 } -538 }; -539 -540 /** -541 * get public key information from PEM certificate -542 * @name getPublicKeyInfoPropOfCertPEM -543 * @memberOf X509 -544 * @function -545 * @param {String} sCertPEM string of PEM formatted certificate -546 * @return {Hash} hash of information for public key -547 * @since x509 1.1.1 -548 * @description -549 * Resulted associative array has following properties:<br/> -550 * <ul> -551 * <li>algoid - hexadecimal string of OID of asymmetric key algorithm</li> -552 * <li>algparam - hexadecimal string of OID of ECC curve name or null</li> -553 * <li>keyhex - hexadecimal string of key in the certificate</li> -554 * </ul> -555 * NOTE: X509v1 certificate is also supported since x509.js 1.1.9. -556 */ -557 X509.getPublicKeyInfoPropOfCertPEM = function(sCertPEM) { -558 var result = {}; -559 result.algparam = null; -560 var hCert = X509.pemToHex(sCertPEM); +411 /** +412 * get a string index of contents of subjectPublicKeyInfo BITSTRING value from hexadecimal certificate<br/> +413 * @name getSubjectPublicKeyPosFromCertHex +414 * @memberOf X509 +415 * @function +416 * @param {String} hexadecimal string of DER RSA/ECDSA/DSA X.509 certificate +417 * @return {Integer} string index of key contents +418 * @example +419 * idx = X509.getSubjectPublicKeyPosFromCertHex("3082..."); +420 */ +421 // NOTE: Without BITSTRING encapsulation. +422 X509.getSubjectPublicKeyPosFromCertHex = function(hCert) { +423 var pInfo = X509.getSubjectPublicKeyInfoPosFromCertHex(hCert); +424 if (pInfo == -1) return -1; +425 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pInfo); +426 if (a.length != 2) return -1; +427 var pBitString = a[1]; +428 if (hCert.substring(pBitString, pBitString + 2) != '03') return -1; +429 var pBitStringV = ASN1HEX.getStartPosOfV_AtObj(hCert, pBitString); +430 +431 if (hCert.substring(pBitStringV, pBitStringV + 2) != '00') return -1; +432 return pBitStringV + 2; +433 }; +434 +435 /** +436 * get a string index of subjectPublicKeyInfo field from hexadecimal certificate<br/> +437 * @name getSubjectPublicKeyInfoPosFromCertHex +438 * @memberOf X509 +439 * @function +440 * @param {String} hexadecimal string of DER RSA/ECDSA/DSA X.509 certificate +441 * @return {Integer} string index of subjectPublicKeyInfo field +442 * @description +443 * This static method gets a string index of subjectPublicKeyInfo field from hexadecimal certificate.<br/> +444 * NOTE1: privateKeyUsagePeriod field of X509v2 not supported.<br/> +445 * NOTE2: X.509v1 and X.509v3 certificate are supported.<br/> +446 * @example +447 * idx = X509.getSubjectPublicKeyInfoPosFromCertHex("3082..."); +448 */ +449 X509.getSubjectPublicKeyInfoPosFromCertHex = function(hCert) { +450 var pTbsCert = ASN1HEX.getStartPosOfV_AtObj(hCert, 0); +451 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pTbsCert); +452 if (a.length < 1) return -1; +453 if (hCert.substring(a[0], a[0] + 10) == "a003020102") { // v3 +454 if (a.length < 6) return -1; +455 return a[6]; +456 } else { +457 if (a.length < 5) return -1; +458 return a[5]; +459 } +460 }; +461 +462 X509.getPublicKeyHexArrayFromCertHex = function(hCert) { +463 var p = X509.getSubjectPublicKeyPosFromCertHex(hCert); +464 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, p); +465 if (a.length != 2) return []; +466 var hN = ASN1HEX.getHexOfV_AtObj(hCert, a[0]); +467 var hE = ASN1HEX.getHexOfV_AtObj(hCert, a[1]); +468 if (hN != null && hE != null) { +469 return [hN, hE]; +470 } else { +471 return []; +472 } +473 }; +474 +475 X509.getHexTbsCertificateFromCert = function(hCert) { +476 var pTbsCert = ASN1HEX.getStartPosOfV_AtObj(hCert, 0); +477 return pTbsCert; +478 }; +479 +480 X509.getPublicKeyHexArrayFromCertPEM = function(sCertPEM) { +481 var hCert = X509.pemToHex(sCertPEM); +482 var a = X509.getPublicKeyHexArrayFromCertHex(hCert); +483 return a; +484 }; +485 +486 X509.hex2dn = function(hDN) { +487 var s = ""; +488 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0); +489 for (var i = 0; i < a.length; i++) { +490 var hRDN = ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]); +491 s = s + "/" + X509.hex2rdn(hRDN); +492 } +493 return s; +494 }; +495 +496 X509.hex2rdn = function(hRDN) { +497 var hType = ASN1HEX.getDecendantHexTLVByNthList(hRDN, 0, [0, 0]); +498 var hValue = ASN1HEX.getDecendantHexVByNthList(hRDN, 0, [0, 1]); +499 var type = ""; +500 try { type = X509.DN_ATTRHEX[hType]; } catch (ex) { type = hType; } +501 hValue = hValue.replace(/(..)/g, "%$1"); +502 var value = decodeURIComponent(hValue); +503 return type + "=" + value; +504 }; +505 +506 X509.DN_ATTRHEX = { +507 "0603550406": "C", +508 "060355040a": "O", +509 "060355040b": "OU", +510 "0603550403": "CN", +511 "0603550405": "SN", +512 "0603550408": "ST", +513 "0603550407": "L", +514 "0603550409": "streetAddress", +515 "060355040f": "businessCategory", +516 "0603550411": "postalCode", +517 "060b2b0601040182373c020102": "jurisdictionOfIncorporationSP", +518 "060b2b0601040182373c020103": "jurisdictionOfIncorporationC", +519 }; +520 +521 /** +522 * get RSAKey/ECDSA public key object from PEM certificate string +523 * @name getPublicKeyFromCertPEM +524 * @memberOf X509 +525 * @function +526 * @param {String} sCertPEM PEM formatted RSA/ECDSA/DSA X.509 certificate +527 * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key +528 * @since x509 1.1.1 +529 * @description +530 * NOTE: DSA is also supported since x509 1.1.2. +531 */ +532 X509.getPublicKeyFromCertPEM = function(sCertPEM) { +533 var info = X509.getPublicKeyInfoPropOfCertPEM(sCertPEM); +534 +535 if (info.algoid == "2a864886f70d010101") { // RSA +536 var aRSA = KEYUTIL.parsePublicRawRSAKeyHex(info.keyhex); +537 var key = new RSAKey(); +538 key.setPublic(aRSA.n, aRSA.e); +539 return key; +540 } else if (info.algoid == "2a8648ce3d0201") { // ECC +541 var curveName = KJUR.crypto.OID.oidhex2name[info.algparam]; +542 var key = new KJUR.crypto.ECDSA({'curve': curveName, 'info': info.keyhex}); +543 key.setPublicKeyHex(info.keyhex); +544 return key; +545 } else if (info.algoid == "2a8648ce380401") { // DSA 1.2.840.10040.4.1 +546 var p = ASN1HEX.getVbyList(info.algparam, 0, [0], "02"); +547 var q = ASN1HEX.getVbyList(info.algparam, 0, [1], "02"); +548 var g = ASN1HEX.getVbyList(info.algparam, 0, [2], "02"); +549 var y = ASN1HEX.getHexOfV_AtObj(info.keyhex, 0); +550 y = y.substr(2); +551 var key = new KJUR.crypto.DSA(); +552 key.setPublic(new BigInteger(p, 16), +553 new BigInteger(q, 16), +554 new BigInteger(g, 16), +555 new BigInteger(y, 16)); +556 return key; +557 } else { +558 throw "unsupported key"; +559 } +560 }; 561 -562 // 1. Certificate ASN.1 -563 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); -564 if (a1.length != 3) -565 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert -566 -567 // 2. tbsCertificate -568 if (hCert.substr(a1[0], 2) != "30") -569 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq -570 -571 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); -572 -573 // 3. subjectPublicKeyInfo -574 var idx_spi = 6; // subjectPublicKeyInfo index in tbsCert for v3 cert -575 if (hCert.substr(a2[0], 2) !== "a0") idx_spi = 5; -576 -577 if (a2.length < idx_spi + 1) -578 throw "malformed X.509 certificate PEM (code:003)"; // no subjPubKeyInfo -579 -580 var a3 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a2[idx_spi]); -581 -582 if (a3.length != 2) -583 throw "malformed X.509 certificate PEM (code:004)"; // not AlgId and PubKey -584 -585 // 4. AlgId -586 var a4 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a3[0]); -587 -588 if (a4.length != 2) -589 throw "malformed X.509 certificate PEM (code:005)"; // not 2 item in AlgId -590 -591 result.algoid = ASN1HEX.getHexOfV_AtObj(hCert, a4[0]); +562 /** +563 * get public key information from PEM certificate +564 * @name getPublicKeyInfoPropOfCertPEM +565 * @memberOf X509 +566 * @function +567 * @param {String} sCertPEM string of PEM formatted certificate +568 * @return {Hash} hash of information for public key +569 * @since x509 1.1.1 +570 * @description +571 * Resulted associative array has following properties:<br/> +572 * <ul> +573 * <li>algoid - hexadecimal string of OID of asymmetric key algorithm</li> +574 * <li>algparam - hexadecimal string of OID of ECC curve name or null</li> +575 * <li>keyhex - hexadecimal string of key in the certificate</li> +576 * </ul> +577 * NOTE: X509v1 certificate is also supported since x509.js 1.1.9. +578 */ +579 X509.getPublicKeyInfoPropOfCertPEM = function(sCertPEM) { +580 var result = {}; +581 result.algparam = null; +582 var hCert = X509.pemToHex(sCertPEM); +583 +584 // 1. Certificate ASN.1 +585 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); +586 if (a1.length != 3) +587 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert +588 +589 // 2. tbsCertificate +590 if (hCert.substr(a1[0], 2) != "30") +591 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq 592 -593 if (hCert.substr(a4[1], 2) == "06") { // EC -594 result.algparam = ASN1HEX.getHexOfV_AtObj(hCert, a4[1]); -595 } else if (hCert.substr(a4[1], 2) == "30") { // DSA -596 result.algparam = ASN1HEX.getHexOfTLV_AtObj(hCert, a4[1]); -597 } +593 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); +594 +595 // 3. subjectPublicKeyInfo +596 var idx_spi = 6; // subjectPublicKeyInfo index in tbsCert for v3 cert +597 if (hCert.substr(a2[0], 2) !== "a0") idx_spi = 5; 598 -599 // 5. Public Key Hex -600 if (hCert.substr(a3[1], 2) != "03") -601 throw "malformed X.509 certificate PEM (code:006)"; // not bitstring -602 -603 var unusedBitAndKeyHex = ASN1HEX.getHexOfV_AtObj(hCert, a3[1]); -604 result.keyhex = unusedBitAndKeyHex.substr(2); -605 -606 return result; -607 }; -608 -609 /** -610 * get position of subjectPublicKeyInfo field from HEX certificate -611 * @name getPublicKeyInfoPosOfCertHEX -612 * @memberOf X509 -613 * @function -614 * @param {String} hCert hexadecimal string of certificate -615 * @return {Integer} position in hexadecimal string -616 * @since x509 1.1.4 -617 * @description -618 * get position for SubjectPublicKeyInfo field in the hexadecimal string of -619 * certificate. -620 */ -621 X509.getPublicKeyInfoPosOfCertHEX = function(hCert) { -622 // 1. Certificate ASN.1 -623 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); -624 if (a1.length != 3) -625 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert -626 -627 // 2. tbsCertificate -628 if (hCert.substr(a1[0], 2) != "30") -629 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq +599 if (a2.length < idx_spi + 1) +600 throw "malformed X.509 certificate PEM (code:003)"; // no subjPubKeyInfo +601 +602 var a3 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a2[idx_spi]); +603 +604 if (a3.length != 2) +605 throw "malformed X.509 certificate PEM (code:004)"; // not AlgId and PubKey +606 +607 // 4. AlgId +608 var a4 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a3[0]); +609 +610 if (a4.length != 2) +611 throw "malformed X.509 certificate PEM (code:005)"; // not 2 item in AlgId +612 +613 result.algoid = ASN1HEX.getHexOfV_AtObj(hCert, a4[0]); +614 +615 if (hCert.substr(a4[1], 2) == "06") { // EC +616 result.algparam = ASN1HEX.getHexOfV_AtObj(hCert, a4[1]); +617 } else if (hCert.substr(a4[1], 2) == "30") { // DSA +618 result.algparam = ASN1HEX.getHexOfTLV_AtObj(hCert, a4[1]); +619 } +620 +621 // 5. Public Key Hex +622 if (hCert.substr(a3[1], 2) != "03") +623 throw "malformed X.509 certificate PEM (code:006)"; // not bitstring +624 +625 var unusedBitAndKeyHex = ASN1HEX.getHexOfV_AtObj(hCert, a3[1]); +626 result.keyhex = unusedBitAndKeyHex.substr(2); +627 +628 return result; +629 }; 630 -631 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); -632 -633 // 3. subjectPublicKeyInfo -634 if (a2.length < 7) -635 throw "malformed X.509 certificate PEM (code:003)"; // no subjPubKeyInfo -636 -637 return a2[6]; -638 }; -639 -640 /** -641 * get array of X.509 V3 extension value information in hex string of certificate -642 * @name getV3ExtInfoListOfCertHex -643 * @memberOf X509 -644 * @function -645 * @param {String} hCert hexadecimal string of X.509 certificate binary -646 * @return {Array} array of result object by {@link X509.getV3ExtInfoListOfCertHex} -647 * @since x509 1.1.5 -648 * @description -649 * This method will get all extension information of a X.509 certificate. -650 * Items of resulting array has following properties: -651 * <ul> -652 * <li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li> -653 * <li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li> -654 * <li>critical - critical flag value for this extension</li> -655 * <li>posV - index of ASN.1 TLV for the extension value. -656 * This is a position of a content of ENCAPSULATED OCTET STRING.</li> -657 * </ul> -658 * @example -659 * hCert = X509.pemToHex(certGithubPEM); -660 * a = X509.getV3ExtInfoListOfCertHex(hCert); -661 * // Then a will be an array of like following: -662 * [{posTLV: 1952, oid: "2.5.29.35", critical: false, posV: 1968}, -663 * {posTLV: 1974, oid: "2.5.29.19", critical: true, posV: 1986}, ...] -664 */ -665 X509.getV3ExtInfoListOfCertHex = function(hCert) { -666 // 1. Certificate ASN.1 -667 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); -668 if (a1.length != 3) -669 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert -670 -671 // 2. tbsCertificate -672 if (hCert.substr(a1[0], 2) != "30") -673 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq -674 -675 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); -676 -677 // 3. v3Extension EXPLICIT Tag [3] -678 // ver, seri, alg, iss, validity, subj, spki, (iui,) (sui,) ext -679 if (a2.length < 8) -680 throw "malformed X.509 certificate PEM (code:003)"; // tbsCert num field too short -681 -682 if (hCert.substr(a2[7], 2) != "a3") -683 throw "malformed X.509 certificate PEM (code:004)"; // not [3] tag -684 -685 var a3 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a2[7]); -686 if (a3.length != 1) -687 throw "malformed X.509 certificate PEM (code:005)"; // [3]tag numChild!=1 -688 -689 // 4. v3Extension SEQUENCE -690 if (hCert.substr(a3[0], 2) != "30") -691 throw "malformed X.509 certificate PEM (code:006)"; // not SEQ +631 /** +632 * get position of subjectPublicKeyInfo field from HEX certificate +633 * @name getPublicKeyInfoPosOfCertHEX +634 * @memberOf X509 +635 * @function +636 * @param {String} hCert hexadecimal string of certificate +637 * @return {Integer} position in hexadecimal string +638 * @since x509 1.1.4 +639 * @description +640 * get position for SubjectPublicKeyInfo field in the hexadecimal string of +641 * certificate. +642 */ +643 X509.getPublicKeyInfoPosOfCertHEX = function(hCert) { +644 // 1. Certificate ASN.1 +645 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); +646 if (a1.length != 3) +647 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert +648 +649 // 2. tbsCertificate +650 if (hCert.substr(a1[0], 2) != "30") +651 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq +652 +653 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); +654 +655 // 3. subjectPublicKeyInfo +656 if (a2.length < 7) +657 throw "malformed X.509 certificate PEM (code:003)"; // no subjPubKeyInfo +658 +659 return a2[6]; +660 }; +661 +662 /** +663 * get array of X.509 V3 extension value information in hex string of certificate +664 * @name getV3ExtInfoListOfCertHex +665 * @memberOf X509 +666 * @function +667 * @param {String} hCert hexadecimal string of X.509 certificate binary +668 * @return {Array} array of result object by {@link X509.getV3ExtInfoListOfCertHex} +669 * @since x509 1.1.5 +670 * @description +671 * This method will get all extension information of a X.509 certificate. +672 * Items of resulting array has following properties: +673 * <ul> +674 * <li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li> +675 * <li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li> +676 * <li>critical - critical flag value for this extension</li> +677 * <li>posV - index of ASN.1 TLV for the extension value. +678 * This is a position of a content of ENCAPSULATED OCTET STRING.</li> +679 * </ul> +680 * @example +681 * hCert = X509.pemToHex(certGithubPEM); +682 * a = X509.getV3ExtInfoListOfCertHex(hCert); +683 * // Then a will be an array of like following: +684 * [{posTLV: 1952, oid: "2.5.29.35", critical: false, posV: 1968}, +685 * {posTLV: 1974, oid: "2.5.29.19", critical: true, posV: 1986}, ...] +686 */ +687 X509.getV3ExtInfoListOfCertHex = function(hCert) { +688 // 1. Certificate ASN.1 +689 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, 0); +690 if (a1.length != 3) +691 throw "malformed X.509 certificate PEM (code:001)"; // not 3 item of seq Cert 692 -693 var a4 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a3[0]); -694 -695 // 5. v3Extension item position -696 var numExt = a4.length; -697 var aInfo = new Array(numExt); -698 for (var i = 0; i < numExt; i++) { -699 aInfo[i] = X509.getV3ExtItemInfo_AtObj(hCert, a4[i]); -700 } -701 return aInfo; -702 }; +693 // 2. tbsCertificate +694 if (hCert.substr(a1[0], 2) != "30") +695 throw "malformed X.509 certificate PEM (code:002)"; // tbsCert not seq +696 +697 var a2 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a1[0]); +698 +699 // 3. v3Extension EXPLICIT Tag [3] +700 // ver, seri, alg, iss, validity, subj, spki, (iui,) (sui,) ext +701 if (a2.length < 8) +702 throw "malformed X.509 certificate PEM (code:003)"; // tbsCert num field too short 703 -704 /** -705 * get X.509 V3 extension value information at the specified position -706 * @name getV3ExtItemInfo_AtObj -707 * @memberOf X509 -708 * @function -709 * @param {String} hCert hexadecimal string of X.509 certificate binary -710 * @param {Integer} pos index of hexadecimal string for the extension -711 * @return {Object} properties for the extension -712 * @since x509 1.1.5 -713 * @description -714 * This method will get some information of a X.509 V extension -715 * which is referred by an index of hexadecimal string of X.509 -716 * certificate. -717 * Resulting object has following properties: -718 * <ul> -719 * <li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li> -720 * <li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li> -721 * <li>critical - critical flag value for this extension</li> -722 * <li>posV - index of ASN.1 TLV for the extension value. -723 * This is a position of a content of ENCAPSULATED OCTET STRING.</li> -724 * </ul> -725 * This method is used by {@link X509.getV3ExtInfoListOfCertHex} internally. -726 */ -727 X509.getV3ExtItemInfo_AtObj = function(hCert, pos) { -728 var info = {}; -729 -730 // posTLV - extension TLV -731 info.posTLV = pos; -732 -733 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pos); -734 if (a.length != 2 && a.length != 3) -735 throw "malformed X.509v3 Ext (code:001)"; // oid,(critical,)val -736 -737 // oid - extension OID -738 if (hCert.substr(a[0], 2) != "06") -739 throw "malformed X.509v3 Ext (code:002)"; // not OID "06" -740 var valueHex = ASN1HEX.getHexOfV_AtObj(hCert, a[0]); -741 info.oid = ASN1HEX.hextooidstr(valueHex); -742 -743 // critical - extension critical flag -744 info.critical = false; // critical false by default -745 if (a.length == 3) info.critical = true; -746 -747 // posV - content TLV position of encapsulated -748 // octet string of V3 extension value. -749 var posExtV = a[a.length - 1]; -750 if (hCert.substr(posExtV, 2) != "04") -751 throw "malformed X.509v3 Ext (code:003)"; // not EncapOctet "04" -752 info.posV = ASN1HEX.getStartPosOfV_AtObj(hCert, posExtV); -753 -754 return info; -755 }; -756 -757 /** -758 * get X.509 V3 extension value ASN.1 TLV for specified oid or name -759 * @name getHexOfTLV_V3ExtValue -760 * @memberOf X509 -761 * @function -762 * @param {String} hCert hexadecimal string of X.509 certificate binary -763 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') -764 * @return {String} hexadecimal string of extension ASN.1 TLV -765 * @since x509 1.1.6 -766 * @description -767 * This method will get X.509v3 extension value of ASN.1 TLV -768 * which is specifyed by extension name or oid. -769 * If there is no such extension in the certificate, it returns null. -770 * @example -771 * hExtValue = X509.getHexOfTLV_V3ExtValue(hCert, "keyUsage"); -772 * // hExtValue will be such like '030205a0'. -773 */ -774 X509.getHexOfTLV_V3ExtValue = function(hCert, oidOrName) { -775 var pos = X509.getPosOfTLV_V3ExtValue(hCert, oidOrName); -776 if (pos == -1) return null; -777 return ASN1HEX.getHexOfTLV_AtObj(hCert, pos); -778 }; -779 -780 /** -781 * get X.509 V3 extension value ASN.1 V for specified oid or name -782 * @name getHexOfV_V3ExtValue -783 * @memberOf X509 -784 * @function -785 * @param {String} hCert hexadecimal string of X.509 certificate binary -786 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') -787 * @return {String} hexadecimal string of extension ASN.1 TLV -788 * @since x509 1.1.6 -789 * @description -790 * This method will get X.509v3 extension value of ASN.1 value -791 * which is specifyed by extension name or oid. -792 * If there is no such extension in the certificate, it returns null. -793 * Available extension names and oids are defined -794 * in the {@link KJUR.asn1.x509.OID} class. -795 * @example -796 * hExtValue = X509.getHexOfV_V3ExtValue(hCert, "keyUsage"); -797 * // hExtValue will be such like '05a0'. -798 */ -799 X509.getHexOfV_V3ExtValue = function(hCert, oidOrName) { -800 var pos = X509.getPosOfTLV_V3ExtValue(hCert, oidOrName); -801 if (pos == -1) return null; -802 return ASN1HEX.getHexOfV_AtObj(hCert, pos); -803 }; -804 -805 /** -806 * get index in the certificate hexa string for specified oid or name specified extension -807 * @name getPosOfTLV_V3ExtValue -808 * @memberOf X509 -809 * @function -810 * @param {String} hCert hexadecimal string of X.509 certificate binary -811 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') -812 * @return {Integer} index in the hexadecimal string of certficate for specified extension -813 * @since x509 1.1.6 -814 * @description -815 * This method will get X.509v3 extension value of ASN.1 V(value) -816 * which is specifyed by extension name or oid. -817 * If there is no such extension in the certificate, -818 * it returns -1. -819 * Available extension names and oids are defined -820 * in the {@link KJUR.asn1.x509.OID} class. -821 * @example -822 * idx = X509.getPosOfV_V3ExtValue(hCert, "keyUsage"); -823 * // The 'idx' will be index in the string for keyUsage value ASN.1 TLV. -824 */ -825 X509.getPosOfTLV_V3ExtValue = function(hCert, oidOrName) { -826 var oid = oidOrName; -827 if (! oidOrName.match(/^[0-9.]+$/)) oid = KJUR.asn1.x509.OID.name2oid(oidOrName); -828 if (oid == '') return -1; -829 -830 var infoList = X509.getV3ExtInfoListOfCertHex(hCert); -831 for (var i = 0; i < infoList.length; i++) { -832 var info = infoList[i]; -833 if (info.oid == oid) return info.posV; -834 } -835 return -1; -836 }; -837 -838 /* ====================================================================== -839 * Specific V3 Extensions -840 * ====================================================================== */ -841 -842 /** -843 * get BasicConstraints extension value as object in the certificate -844 * @name getExtBasicConstraints -845 * @memberOf X509 -846 * @function -847 * @param {String} hCert hexadecimal string of X.509 certificate binary -848 * @return {Object} associative array which may have "cA" and "pathLen" parameters -849 * @since x509 1.1.7 -850 * @description -851 * This method will get basic constraints extension value as object with following paramters. -852 * <ul> -853 * <li>cA - CA flag whether CA or not</li> -854 * <li>pathLen - maximum intermediate certificate length</li> -855 * </ul> -856 * There are use cases for return values: -857 * <ul> -858 * <li>{cA:true, pathLen:3} - cA flag is true and pathLen is 3</li> -859 * <li>{cA:true} - cA flag is true and no pathLen</li> -860 * <li>{} - basic constraints has no value in case of end entity certificate</li> -861 * <li>null - there is no basic constraints extension</li> -862 * </ul> -863 * @example -864 * obj = X509.getExtBasicConstraints(hCert); -865 */ -866 X509.getExtBasicConstraints = function(hCert) { -867 var hBC = X509.getHexOfV_V3ExtValue(hCert, "basicConstraints"); -868 if (hBC === null) return null; -869 if (hBC === '') return {}; -870 if (hBC === '0101ff') return { "cA": true }; -871 if (hBC.substr(0, 8) === '0101ff02') { -872 var pathLexHex = ASN1HEX.getHexOfV_AtObj(hBC, 6); -873 var pathLen = parseInt(pathLexHex, 16); -874 return { "cA": true, "pathLen": pathLen }; -875 } -876 throw "unknown error"; -877 }; -878 -879 X509.KEYUSAGE_NAME = [ -880 "digitalSignature", -881 "nonRepudiation", -882 "keyEncipherment", -883 "dataEncipherment", -884 "keyAgreement", -885 "keyCertSign", -886 "cRLSign", -887 "encipherOnly", -888 "decipherOnly" -889 ]; -890 -891 /** -892 * get KeyUsage extension value as binary string in the certificate -893 * @name getExtKeyUsageBin -894 * @memberOf X509 -895 * @function -896 * @param {String} hCert hexadecimal string of X.509 certificate binary -897 * @return {String} binary string of key usage bits (ex. '101') -898 * @since x509 1.1.6 -899 * @description -900 * This method will get key usage extension value -901 * as binary string such like '101'. -902 * Key usage bits definition is in the RFC 5280. -903 * If there is no key usage extension in the certificate, -904 * it returns empty string (i.e. ''). -905 * @example -906 * bKeyUsage = X509.getExtKeyUsageBin(hCert); -907 * // bKeyUsage will be such like '101'. -908 * // 1 - digitalSignature -909 * // 0 - nonRepudiation -910 * // 1 - keyEncipherment -911 */ -912 X509.getExtKeyUsageBin = function(hCert) { -913 var hKeyUsage = X509.getHexOfV_V3ExtValue(hCert, "keyUsage"); -914 if (hKeyUsage == '') return ''; -915 if (hKeyUsage.length % 2 != 0 || hKeyUsage.length <= 2) -916 throw "malformed key usage value"; -917 var unusedBits = parseInt(hKeyUsage.substr(0, 2)); -918 var bKeyUsage = parseInt(hKeyUsage.substr(2), 16).toString(2); -919 return bKeyUsage.substr(0, bKeyUsage.length - unusedBits); -920 }; -921 -922 /** -923 * get KeyUsage extension value as names in the certificate -924 * @name getExtKeyUsageString -925 * @memberOf X509 -926 * @function -927 * @param {String} hCert hexadecimal string of X.509 certificate binary -928 * @return {String} comma separated string of key usage -929 * @since x509 1.1.6 -930 * @description -931 * This method will get key usage extension value -932 * as comma separated string of usage names. -933 * If there is no key usage extension in the certificate, -934 * it returns empty string (i.e. ''). -935 * @example -936 * sKeyUsage = X509.getExtKeyUsageString(hCert); -937 * // sKeyUsage will be such like 'digitalSignature,keyEncipherment'. -938 */ -939 X509.getExtKeyUsageString = function(hCert) { -940 var bKeyUsage = X509.getExtKeyUsageBin(hCert); -941 var a = new Array(); -942 for (var i = 0; i < bKeyUsage.length; i++) { -943 if (bKeyUsage.substr(i, 1) == "1") a.push(X509.KEYUSAGE_NAME[i]); -944 } -945 return a.join(","); -946 }; -947 -948 /** -949 * get subjectKeyIdentifier value as hexadecimal string in the certificate -950 * @name getExtSubjectKeyIdentifier -951 * @memberOf X509 -952 * @function -953 * @param {String} hCert hexadecimal string of X.509 certificate binary -954 * @return {String} hexadecimal string of subject key identifier or null -955 * @since jsrsasign 5.0.10 x509 1.1.8 -956 * @description -957 * This method will get subject key identifier extension value -958 * as hexadecimal string. -959 * If there is no its extension in the certificate, -960 * it returns null. -961 * @example -962 * skid = X509.getExtSubjectKeyIdentifier(hCert); -963 */ -964 X509.getExtSubjectKeyIdentifier = function(hCert) { -965 var hSKID = X509.getHexOfV_V3ExtValue(hCert, "subjectKeyIdentifier"); -966 return hSKID; -967 }; -968 -969 /** -970 * get authorityKeyIdentifier value as JSON object in the certificate -971 * @name getExtAuthorityKeyIdentifier -972 * @memberOf X509 -973 * @function -974 * @param {String} hCert hexadecimal string of X.509 certificate binary -975 * @return {Object} JSON object of authority key identifier or null -976 * @since jsrsasign 5.0.10 x509 1.1.8 -977 * @description -978 * This method will get authority key identifier extension value -979 * as JSON object. -980 * If there is no its extension in the certificate, -981 * it returns null. -982 * <br> -983 * NOTE: Currently this method only supports keyIdentifier so that -984 * authorityCertIssuer and authorityCertSerialNumber will not -985 * be return in the JSON object. -986 * @example -987 * akid = X509.getExtAuthorityKeyIdentifier(hCert); -988 * // returns following JSON object -989 * { kid: "1234abcd..." } -990 */ -991 X509.getExtAuthorityKeyIdentifier = function(hCert) { -992 var result = {}; -993 var hAKID = X509.getHexOfTLV_V3ExtValue(hCert, "authorityKeyIdentifier"); -994 if (hAKID === null) return null; -995 -996 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hAKID, 0); -997 for (var i = 0; i < a.length; i++) { -998 if (hAKID.substr(a[i], 2) === "80") -999 result.kid = ASN1HEX.getHexOfV_AtObj(hAKID, a[i]); -1000 } -1001 -1002 return result; -1003 }; -1004 -1005 /** -1006 * get extKeyUsage value as array of name string in the certificate -1007 * @name getExtExtKeyUsageName -1008 * @memberOf X509 -1009 * @function -1010 * @param {String} hCert hexadecimal string of X.509 certificate binary -1011 * @return {Object} array of extended key usage ID name or oid -1012 * @since jsrsasign 5.0.10 x509 1.1.8 -1013 * @description -1014 * This method will get extended key usage extension value -1015 * as array of name or OID string. -1016 * If there is no its extension in the certificate, -1017 * it returns null. -1018 * <br> -1019 * NOTE: Supported extended key usage ID names are defined in -1020 * name2oidList parameter in asn1x509.js file. -1021 * @example -1022 * eku = X509.getExtExtKeyUsageName(hCert); -1023 * // returns following array: -1024 * ["serverAuth", "clientAuth", "0.1.2.3.4.5"] -1025 */ -1026 X509.getExtExtKeyUsageName = function(hCert) { -1027 var result = new Array(); -1028 var h = X509.getHexOfTLV_V3ExtValue(hCert, "extKeyUsage"); -1029 if (h === null) return null; -1030 -1031 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); -1032 for (var i = 0; i < a.length; i++) { -1033 var hex = ASN1HEX.getHexOfV_AtObj(h, a[i]); -1034 var oid = KJUR.asn1.ASN1Util.oidHexToInt(hex); -1035 var name = KJUR.asn1.x509.OID.oid2name(oid); -1036 result.push(name); -1037 } -1038 -1039 return result; -1040 }; -1041 -1042 /** -1043 * get subjectAltName value as array of string in the certificate -1044 * @name getExtSubjectAltName -1045 * @memberOf X509 -1046 * @function -1047 * @param {String} hCert hexadecimal string of X.509 certificate binary -1048 * @return {Object} array of alt names -1049 * @since jsrsasign 5.0.10 x509 1.1.8 -1050 * @description -1051 * This method will get subject alt name extension value -1052 * as array of name. -1053 * If there is no its extension in the certificate, -1054 * it returns null. -1055 * <br> -1056 * NOTE: Currently this method supports only dNSName so that -1057 * other name type such like iPAddress or generalName will not be returned. -1058 * @example -1059 * san = X509.getExtSubjectAltName(hCert); -1060 * // returns following array: -1061 * ["example.com", "example.org"] -1062 */ -1063 X509.getExtSubjectAltName = function(hCert) { -1064 var result = new Array(); -1065 var h = X509.getHexOfTLV_V3ExtValue(hCert, "subjectAltName"); -1066 -1067 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); -1068 for (var i = 0; i < a.length; i++) { -1069 if (h.substr(a[i], 2) === "82") { -1070 var fqdn = hextoutf8(ASN1HEX.getHexOfV_AtObj(h, a[i])); -1071 result.push(fqdn); -1072 } -1073 } -1074 -1075 return result; -1076 }; -1077 -1078 /** -1079 * get array of string for fullName URIs in cRLDistributionPoints(CDP) in the certificate -1080 * @name getExtCRLDistributionPointsURI -1081 * @memberOf X509 -1082 * @function -1083 * @param {String} hCert hexadecimal string of X.509 certificate binary -1084 * @return {Object} array of fullName URIs of CDP of the certificate -1085 * @since jsrsasign 5.0.10 x509 1.1.8 -1086 * @description -1087 * This method will get all fullName URIs of cRLDistributionPoints extension -1088 * in the certificate as array of URI string. -1089 * If there is no its extension in the certificate, -1090 * it returns null. -1091 * <br> -1092 * NOTE: Currently this method supports only fullName URI so that -1093 * other parameters will not be returned. -1094 * @example -1095 * cdpuri = X509.getExtCRLDistributionPointsURI(hCert); -1096 * // returns following array: -1097 * ["http://example.com/aaa.crl", "http://example.org/aaa.crl"] -1098 */ -1099 X509.getExtCRLDistributionPointsURI = function(hCert) { -1100 var result = new Array(); -1101 var h = X509.getHexOfTLV_V3ExtValue(hCert, "cRLDistributionPoints"); -1102 -1103 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); -1104 for (var i = 0; i < a.length; i++) { -1105 var hDP = ASN1HEX.getHexOfTLV_AtObj(h, a[i]); -1106 -1107 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hDP, 0); -1108 for (var j = 0; j < a1.length; j++) { -1109 if (hDP.substr(a1[j], 2) === "a0") { -1110 var hDPN = ASN1HEX.getHexOfV_AtObj(hDP, a1[j]); -1111 if (hDPN.substr(0, 2) === "a0") { -1112 var hFullName = ASN1HEX.getHexOfV_AtObj(hDPN, 0); -1113 if (hFullName.substr(0, 2) === "86") { -1114 var hURI = ASN1HEX.getHexOfV_AtObj(hFullName, 0); -1115 var uri = hextoutf8(hURI); -1116 result.push(uri); -1117 } -1118 } -1119 } -1120 } -1121 } -1122 -1123 return result; -1124 }; -1125 -1126 /** -1127 * get AuthorityInfoAccess extension value in the certificate as associative array -1128 * @name getExtAIAInfo -1129 * @memberOf X509 -1130 * @function -1131 * @param {String} hCert hexadecimal string of X.509 certificate binary -1132 * @return {Object} associative array of AIA extension properties -1133 * @since x509 1.1.6 -1134 * @description -1135 * This method will get authority info access value -1136 * as associate array which has following properties: -1137 * <ul> -1138 * <li>ocsp - array of string for OCSP responder URL</li> -1139 * <li>caissuer - array of string for caIssuer value (i.e. CA certificates URL)</li> -1140 * </ul> -1141 * If there is no key usage extension in the certificate, -1142 * it returns null; -1143 * @example -1144 * oAIA = X509.getExtAIAInfo(hCert); -1145 * // result will be such like: -1146 * // oAIA.ocsp = ["http://ocsp.foo.com"]; -1147 * // oAIA.caissuer = ["http://rep.foo.com/aaa.p8m"]; -1148 */ -1149 X509.getExtAIAInfo = function(hCert) { -1150 var result = {}; -1151 result.ocsp = []; -1152 result.caissuer = []; -1153 var pos1 = X509.getPosOfTLV_V3ExtValue(hCert, "authorityInfoAccess"); -1154 if (pos1 == -1) return null; -1155 if (hCert.substr(pos1, 2) != "30") // extnValue SEQUENCE -1156 throw "malformed AIA Extn Value"; -1157 -1158 var posAccDescList = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pos1); -1159 for (var i = 0; i < posAccDescList.length; i++) { -1160 var p = posAccDescList[i]; -1161 var posAccDescChild = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, p); -1162 if (posAccDescChild.length != 2) -1163 throw "malformed AccessDescription of AIA Extn"; -1164 var pOID = posAccDescChild[0]; -1165 var pName = posAccDescChild[1]; -1166 if (ASN1HEX.getHexOfV_AtObj(hCert, pOID) == "2b06010505073001") { -1167 if (hCert.substr(pName, 2) == "86") { -1168 result.ocsp.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(hCert, pName))); -1169 } -1170 } -1171 if (ASN1HEX.getHexOfV_AtObj(hCert, pOID) == "2b06010505073002") { -1172 if (hCert.substr(pName, 2) == "86") { -1173 result.caissuer.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(hCert, pName))); -1174 } -1175 } -1176 } -1177 return result; -1178 }; -1179 -1180 /** -1181 * get signature algorithm name from hexadecimal certificate data -1182 * @name getSignatureAlgorithmName -1183 * @memberOf X509 -1184 * @function -1185 * @param {String} hCert hexadecimal string of X.509 certificate binary -1186 * @return {String} signature algorithm name (ex. SHA1withRSA, SHA256withECDSA) -1187 * @since x509 1.1.7 -1188 * @description -1189 * This method will get signature algorithm name of certificate: -1190 * @example -1191 * algName = X509.getSignatureAlgorithmName(hCert); -1192 */ -1193 X509.getSignatureAlgorithmName = function(hCert) { -1194 var sigAlgOidHex = ASN1HEX.getDecendantHexVByNthList(hCert, 0, [1, 0]); -1195 var sigAlgOidInt = KJUR.asn1.ASN1Util.oidHexToInt(sigAlgOidHex); -1196 var sigAlgName = KJUR.asn1.x509.OID.oid2name(sigAlgOidInt); -1197 return sigAlgName; -1198 }; -1199 -1200 /** -1201 * get signature value in hexadecimal string -1202 * @name getSignatureValueHex -1203 * @memberOf X509 -1204 * @function -1205 * @param {String} hCert hexadecimal string of X.509 certificate binary -1206 * @return {String} signature value hexadecimal string without BitString unused bits -1207 * @since x509 1.1.7 -1208 * @description -1209 * This method will get signature value of certificate: -1210 * @example -1211 * sigHex = X509.getSignatureValueHex(hCert); -1212 */ -1213 X509.getSignatureValueHex = function(hCert) { -1214 var h = ASN1HEX.getDecendantHexVByNthList(hCert, 0, [2]); -1215 if (h.substr(0, 2) !== "00") -1216 throw "can't get signature value"; -1217 return h.substr(2); -1218 }; -1219 -1220 X509.getSerialNumberHex = function(hCert) { -1221 return ASN1HEX.getDecendantHexVByNthList(hCert, 0, [0, 1]); -1222 }; -1223 -1224 /* -1225 X509.prototype.readCertPEM = _x509_readCertPEM; -1226 X509.prototype.readCertPEMWithoutRSAInit = _x509_readCertPEMWithoutRSAInit; -1227 X509.prototype.getSerialNumberHex = _x509_getSerialNumberHex; -1228 X509.prototype.getIssuerHex = _x509_getIssuerHex; -1229 X509.prototype.getSubjectHex = _x509_getSubjectHex; -1230 X509.prototype.getIssuerString = _x509_getIssuerString; -1231 X509.prototype.getSubjectString = _x509_getSubjectString; -1232 X509.prototype.getNotBefore = _x509_getNotBefore; -1233 X509.prototype.getNotAfter = _x509_getNotAfter; -1234 */ -1235 \ No newline at end of file +704 if (hCert.substr(a2[7], 2) != "a3") +705 throw "malformed X.509 certificate PEM (code:004)"; // not [3] tag +706 +707 var a3 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a2[7]); +708 if (a3.length != 1) +709 throw "malformed X.509 certificate PEM (code:005)"; // [3]tag numChild!=1 +710 +711 // 4. v3Extension SEQUENCE +712 if (hCert.substr(a3[0], 2) != "30") +713 throw "malformed X.509 certificate PEM (code:006)"; // not SEQ +714 +715 var a4 = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, a3[0]); +716 +717 // 5. v3Extension item position +718 var numExt = a4.length; +719 var aInfo = new Array(numExt); +720 for (var i = 0; i < numExt; i++) { +721 aInfo[i] = X509.getV3ExtItemInfo_AtObj(hCert, a4[i]); +722 } +723 return aInfo; +724 }; +725 +726 /** +727 * get X.509 V3 extension value information at the specified position +728 * @name getV3ExtItemInfo_AtObj +729 * @memberOf X509 +730 * @function +731 * @param {String} hCert hexadecimal string of X.509 certificate binary +732 * @param {Integer} pos index of hexadecimal string for the extension +733 * @return {Object} properties for the extension +734 * @since x509 1.1.5 +735 * @description +736 * This method will get some information of a X.509 V extension +737 * which is referred by an index of hexadecimal string of X.509 +738 * certificate. +739 * Resulting object has following properties: +740 * <ul> +741 * <li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li> +742 * <li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li> +743 * <li>critical - critical flag value for this extension</li> +744 * <li>posV - index of ASN.1 TLV for the extension value. +745 * This is a position of a content of ENCAPSULATED OCTET STRING.</li> +746 * </ul> +747 * This method is used by {@link X509.getV3ExtInfoListOfCertHex} internally. +748 */ +749 X509.getV3ExtItemInfo_AtObj = function(hCert, pos) { +750 var info = {}; +751 +752 // posTLV - extension TLV +753 info.posTLV = pos; +754 +755 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pos); +756 if (a.length != 2 && a.length != 3) +757 throw "malformed X.509v3 Ext (code:001)"; // oid,(critical,)val +758 +759 // oid - extension OID +760 if (hCert.substr(a[0], 2) != "06") +761 throw "malformed X.509v3 Ext (code:002)"; // not OID "06" +762 var valueHex = ASN1HEX.getHexOfV_AtObj(hCert, a[0]); +763 info.oid = ASN1HEX.hextooidstr(valueHex); +764 +765 // critical - extension critical flag +766 info.critical = false; // critical false by default +767 if (a.length == 3) info.critical = true; +768 +769 // posV - content TLV position of encapsulated +770 // octet string of V3 extension value. +771 var posExtV = a[a.length - 1]; +772 if (hCert.substr(posExtV, 2) != "04") +773 throw "malformed X.509v3 Ext (code:003)"; // not EncapOctet "04" +774 info.posV = ASN1HEX.getStartPosOfV_AtObj(hCert, posExtV); +775 +776 return info; +777 }; +778 +779 /** +780 * get X.509 V3 extension value ASN.1 TLV for specified oid or name +781 * @name getHexOfTLV_V3ExtValue +782 * @memberOf X509 +783 * @function +784 * @param {String} hCert hexadecimal string of X.509 certificate binary +785 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') +786 * @return {String} hexadecimal string of extension ASN.1 TLV +787 * @since x509 1.1.6 +788 * @description +789 * This method will get X.509v3 extension value of ASN.1 TLV +790 * which is specifyed by extension name or oid. +791 * If there is no such extension in the certificate, it returns null. +792 * @example +793 * hExtValue = X509.getHexOfTLV_V3ExtValue(hCert, "keyUsage"); +794 * // hExtValue will be such like '030205a0'. +795 */ +796 X509.getHexOfTLV_V3ExtValue = function(hCert, oidOrName) { +797 var pos = X509.getPosOfTLV_V3ExtValue(hCert, oidOrName); +798 if (pos == -1) return null; +799 return ASN1HEX.getHexOfTLV_AtObj(hCert, pos); +800 }; +801 +802 /** +803 * get X.509 V3 extension value ASN.1 V for specified oid or name +804 * @name getHexOfV_V3ExtValue +805 * @memberOf X509 +806 * @function +807 * @param {String} hCert hexadecimal string of X.509 certificate binary +808 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') +809 * @return {String} hexadecimal string of extension ASN.1 TLV +810 * @since x509 1.1.6 +811 * @description +812 * This method will get X.509v3 extension value of ASN.1 value +813 * which is specifyed by extension name or oid. +814 * If there is no such extension in the certificate, it returns null. +815 * Available extension names and oids are defined +816 * in the {@link KJUR.asn1.x509.OID} class. +817 * @example +818 * hExtValue = X509.getHexOfV_V3ExtValue(hCert, "keyUsage"); +819 * // hExtValue will be such like '05a0'. +820 */ +821 X509.getHexOfV_V3ExtValue = function(hCert, oidOrName) { +822 var pos = X509.getPosOfTLV_V3ExtValue(hCert, oidOrName); +823 if (pos == -1) return null; +824 return ASN1HEX.getHexOfV_AtObj(hCert, pos); +825 }; +826 +827 /** +828 * get index in the certificate hexa string for specified oid or name specified extension +829 * @name getPosOfTLV_V3ExtValue +830 * @memberOf X509 +831 * @function +832 * @param {String} hCert hexadecimal string of X.509 certificate binary +833 * @param {String} oidOrName oid or name for extension (ex. 'keyUsage' or '2.5.29.15') +834 * @return {Integer} index in the hexadecimal string of certficate for specified extension +835 * @since x509 1.1.6 +836 * @description +837 * This method will get X.509v3 extension value of ASN.1 V(value) +838 * which is specifyed by extension name or oid. +839 * If there is no such extension in the certificate, +840 * it returns -1. +841 * Available extension names and oids are defined +842 * in the {@link KJUR.asn1.x509.OID} class. +843 * @example +844 * idx = X509.getPosOfV_V3ExtValue(hCert, "keyUsage"); +845 * // The 'idx' will be index in the string for keyUsage value ASN.1 TLV. +846 */ +847 X509.getPosOfTLV_V3ExtValue = function(hCert, oidOrName) { +848 var oid = oidOrName; +849 if (! oidOrName.match(/^[0-9.]+$/)) oid = KJUR.asn1.x509.OID.name2oid(oidOrName); +850 if (oid == '') return -1; +851 +852 var infoList = X509.getV3ExtInfoListOfCertHex(hCert); +853 for (var i = 0; i < infoList.length; i++) { +854 var info = infoList[i]; +855 if (info.oid == oid) return info.posV; +856 } +857 return -1; +858 }; +859 +860 /* ====================================================================== +861 * Specific V3 Extensions +862 * ====================================================================== */ +863 +864 /** +865 * get BasicConstraints extension value as object in the certificate +866 * @name getExtBasicConstraints +867 * @memberOf X509 +868 * @function +869 * @param {String} hCert hexadecimal string of X.509 certificate binary +870 * @return {Object} associative array which may have "cA" and "pathLen" parameters +871 * @since x509 1.1.7 +872 * @description +873 * This method will get basic constraints extension value as object with following paramters. +874 * <ul> +875 * <li>cA - CA flag whether CA or not</li> +876 * <li>pathLen - maximum intermediate certificate length</li> +877 * </ul> +878 * There are use cases for return values: +879 * <ul> +880 * <li>{cA:true, pathLen:3} - cA flag is true and pathLen is 3</li> +881 * <li>{cA:true} - cA flag is true and no pathLen</li> +882 * <li>{} - basic constraints has no value in case of end entity certificate</li> +883 * <li>null - there is no basic constraints extension</li> +884 * </ul> +885 * @example +886 * obj = X509.getExtBasicConstraints(hCert); +887 */ +888 X509.getExtBasicConstraints = function(hCert) { +889 var hBC = X509.getHexOfV_V3ExtValue(hCert, "basicConstraints"); +890 if (hBC === null) return null; +891 if (hBC === '') return {}; +892 if (hBC === '0101ff') return { "cA": true }; +893 if (hBC.substr(0, 8) === '0101ff02') { +894 var pathLexHex = ASN1HEX.getHexOfV_AtObj(hBC, 6); +895 var pathLen = parseInt(pathLexHex, 16); +896 return { "cA": true, "pathLen": pathLen }; +897 } +898 throw "unknown error"; +899 }; +900 +901 X509.KEYUSAGE_NAME = [ +902 "digitalSignature", +903 "nonRepudiation", +904 "keyEncipherment", +905 "dataEncipherment", +906 "keyAgreement", +907 "keyCertSign", +908 "cRLSign", +909 "encipherOnly", +910 "decipherOnly" +911 ]; +912 +913 /** +914 * get KeyUsage extension value as binary string in the certificate +915 * @name getExtKeyUsageBin +916 * @memberOf X509 +917 * @function +918 * @param {String} hCert hexadecimal string of X.509 certificate binary +919 * @return {String} binary string of key usage bits (ex. '101') +920 * @since x509 1.1.6 +921 * @description +922 * This method will get key usage extension value +923 * as binary string such like '101'. +924 * Key usage bits definition is in the RFC 5280. +925 * If there is no key usage extension in the certificate, +926 * it returns empty string (i.e. ''). +927 * @example +928 * bKeyUsage = X509.getExtKeyUsageBin(hCert); +929 * // bKeyUsage will be such like '101'. +930 * // 1 - digitalSignature +931 * // 0 - nonRepudiation +932 * // 1 - keyEncipherment +933 */ +934 X509.getExtKeyUsageBin = function(hCert) { +935 var hKeyUsage = X509.getHexOfV_V3ExtValue(hCert, "keyUsage"); +936 if (hKeyUsage == '') return ''; +937 if (hKeyUsage.length % 2 != 0 || hKeyUsage.length <= 2) +938 throw "malformed key usage value"; +939 var unusedBits = parseInt(hKeyUsage.substr(0, 2)); +940 var bKeyUsage = parseInt(hKeyUsage.substr(2), 16).toString(2); +941 return bKeyUsage.substr(0, bKeyUsage.length - unusedBits); +942 }; +943 +944 /** +945 * get KeyUsage extension value as names in the certificate +946 * @name getExtKeyUsageString +947 * @memberOf X509 +948 * @function +949 * @param {String} hCert hexadecimal string of X.509 certificate binary +950 * @return {String} comma separated string of key usage +951 * @since x509 1.1.6 +952 * @description +953 * This method will get key usage extension value +954 * as comma separated string of usage names. +955 * If there is no key usage extension in the certificate, +956 * it returns empty string (i.e. ''). +957 * @example +958 * sKeyUsage = X509.getExtKeyUsageString(hCert); +959 * // sKeyUsage will be such like 'digitalSignature,keyEncipherment'. +960 */ +961 X509.getExtKeyUsageString = function(hCert) { +962 var bKeyUsage = X509.getExtKeyUsageBin(hCert); +963 var a = new Array(); +964 for (var i = 0; i < bKeyUsage.length; i++) { +965 if (bKeyUsage.substr(i, 1) == "1") a.push(X509.KEYUSAGE_NAME[i]); +966 } +967 return a.join(","); +968 }; +969 +970 /** +971 * get subjectKeyIdentifier value as hexadecimal string in the certificate +972 * @name getExtSubjectKeyIdentifier +973 * @memberOf X509 +974 * @function +975 * @param {String} hCert hexadecimal string of X.509 certificate binary +976 * @return {String} hexadecimal string of subject key identifier or null +977 * @since jsrsasign 5.0.10 x509 1.1.8 +978 * @description +979 * This method will get subject key identifier extension value +980 * as hexadecimal string. +981 * If there is no its extension in the certificate, +982 * it returns null. +983 * @example +984 * skid = X509.getExtSubjectKeyIdentifier(hCert); +985 */ +986 X509.getExtSubjectKeyIdentifier = function(hCert) { +987 var hSKID = X509.getHexOfV_V3ExtValue(hCert, "subjectKeyIdentifier"); +988 return hSKID; +989 }; +990 +991 /** +992 * get authorityKeyIdentifier value as JSON object in the certificate +993 * @name getExtAuthorityKeyIdentifier +994 * @memberOf X509 +995 * @function +996 * @param {String} hCert hexadecimal string of X.509 certificate binary +997 * @return {Object} JSON object of authority key identifier or null +998 * @since jsrsasign 5.0.10 x509 1.1.8 +999 * @description +1000 * This method will get authority key identifier extension value +1001 * as JSON object. +1002 * If there is no its extension in the certificate, +1003 * it returns null. +1004 * <br> +1005 * NOTE: Currently this method only supports keyIdentifier so that +1006 * authorityCertIssuer and authorityCertSerialNumber will not +1007 * be return in the JSON object. +1008 * @example +1009 * akid = X509.getExtAuthorityKeyIdentifier(hCert); +1010 * // returns following JSON object +1011 * { kid: "1234abcd..." } +1012 */ +1013 X509.getExtAuthorityKeyIdentifier = function(hCert) { +1014 var result = {}; +1015 var hAKID = X509.getHexOfTLV_V3ExtValue(hCert, "authorityKeyIdentifier"); +1016 if (hAKID === null) return null; +1017 +1018 var a = ASN1HEX.getPosArrayOfChildren_AtObj(hAKID, 0); +1019 for (var i = 0; i < a.length; i++) { +1020 if (hAKID.substr(a[i], 2) === "80") +1021 result.kid = ASN1HEX.getHexOfV_AtObj(hAKID, a[i]); +1022 } +1023 +1024 return result; +1025 }; +1026 +1027 /** +1028 * get extKeyUsage value as array of name string in the certificate +1029 * @name getExtExtKeyUsageName +1030 * @memberOf X509 +1031 * @function +1032 * @param {String} hCert hexadecimal string of X.509 certificate binary +1033 * @return {Object} array of extended key usage ID name or oid +1034 * @since jsrsasign 5.0.10 x509 1.1.8 +1035 * @description +1036 * This method will get extended key usage extension value +1037 * as array of name or OID string. +1038 * If there is no its extension in the certificate, +1039 * it returns null. +1040 * <br> +1041 * NOTE: Supported extended key usage ID names are defined in +1042 * name2oidList parameter in asn1x509.js file. +1043 * @example +1044 * eku = X509.getExtExtKeyUsageName(hCert); +1045 * // returns following array: +1046 * ["serverAuth", "clientAuth", "0.1.2.3.4.5"] +1047 */ +1048 X509.getExtExtKeyUsageName = function(hCert) { +1049 var result = new Array(); +1050 var h = X509.getHexOfTLV_V3ExtValue(hCert, "extKeyUsage"); +1051 if (h === null) return null; +1052 +1053 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); +1054 for (var i = 0; i < a.length; i++) { +1055 var hex = ASN1HEX.getHexOfV_AtObj(h, a[i]); +1056 var oid = KJUR.asn1.ASN1Util.oidHexToInt(hex); +1057 var name = KJUR.asn1.x509.OID.oid2name(oid); +1058 result.push(name); +1059 } +1060 +1061 return result; +1062 }; +1063 +1064 /** +1065 * get subjectAltName value as array of string in the certificate +1066 * @name getExtSubjectAltName +1067 * @memberOf X509 +1068 * @function +1069 * @param {String} hCert hexadecimal string of X.509 certificate binary +1070 * @return {Object} array of alt names +1071 * @since jsrsasign 5.0.10 x509 1.1.8 +1072 * @description +1073 * This method will get subject alt name extension value +1074 * as array of name. +1075 * If there is no its extension in the certificate, +1076 * it returns null. +1077 * <br> +1078 * NOTE: Currently this method supports only dNSName so that +1079 * other name type such like iPAddress or generalName will not be returned. +1080 * @example +1081 * san = X509.getExtSubjectAltName(hCert); +1082 * // returns following array: +1083 * ["example.com", "example.org"] +1084 */ +1085 X509.getExtSubjectAltName = function(hCert) { +1086 var result = new Array(); +1087 var h = X509.getHexOfTLV_V3ExtValue(hCert, "subjectAltName"); +1088 +1089 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); +1090 for (var i = 0; i < a.length; i++) { +1091 if (h.substr(a[i], 2) === "82") { +1092 var fqdn = hextoutf8(ASN1HEX.getHexOfV_AtObj(h, a[i])); +1093 result.push(fqdn); +1094 } +1095 } +1096 +1097 return result; +1098 }; +1099 +1100 /** +1101 * get array of string for fullName URIs in cRLDistributionPoints(CDP) in the certificate +1102 * @name getExtCRLDistributionPointsURI +1103 * @memberOf X509 +1104 * @function +1105 * @param {String} hCert hexadecimal string of X.509 certificate binary +1106 * @return {Object} array of fullName URIs of CDP of the certificate +1107 * @since jsrsasign 5.0.10 x509 1.1.8 +1108 * @description +1109 * This method will get all fullName URIs of cRLDistributionPoints extension +1110 * in the certificate as array of URI string. +1111 * If there is no its extension in the certificate, +1112 * it returns null. +1113 * <br> +1114 * NOTE: Currently this method supports only fullName URI so that +1115 * other parameters will not be returned. +1116 * @example +1117 * cdpuri = X509.getExtCRLDistributionPointsURI(hCert); +1118 * // returns following array: +1119 * ["http://example.com/aaa.crl", "http://example.org/aaa.crl"] +1120 */ +1121 X509.getExtCRLDistributionPointsURI = function(hCert) { +1122 var result = new Array(); +1123 var h = X509.getHexOfTLV_V3ExtValue(hCert, "cRLDistributionPoints"); +1124 +1125 var a = ASN1HEX.getPosArrayOfChildren_AtObj(h, 0); +1126 for (var i = 0; i < a.length; i++) { +1127 var hDP = ASN1HEX.getHexOfTLV_AtObj(h, a[i]); +1128 +1129 var a1 = ASN1HEX.getPosArrayOfChildren_AtObj(hDP, 0); +1130 for (var j = 0; j < a1.length; j++) { +1131 if (hDP.substr(a1[j], 2) === "a0") { +1132 var hDPN = ASN1HEX.getHexOfV_AtObj(hDP, a1[j]); +1133 if (hDPN.substr(0, 2) === "a0") { +1134 var hFullName = ASN1HEX.getHexOfV_AtObj(hDPN, 0); +1135 if (hFullName.substr(0, 2) === "86") { +1136 var hURI = ASN1HEX.getHexOfV_AtObj(hFullName, 0); +1137 var uri = hextoutf8(hURI); +1138 result.push(uri); +1139 } +1140 } +1141 } +1142 } +1143 } +1144 +1145 return result; +1146 }; +1147 +1148 /** +1149 * get AuthorityInfoAccess extension value in the certificate as associative array +1150 * @name getExtAIAInfo +1151 * @memberOf X509 +1152 * @function +1153 * @param {String} hCert hexadecimal string of X.509 certificate binary +1154 * @return {Object} associative array of AIA extension properties +1155 * @since x509 1.1.6 +1156 * @description +1157 * This method will get authority info access value +1158 * as associate array which has following properties: +1159 * <ul> +1160 * <li>ocsp - array of string for OCSP responder URL</li> +1161 * <li>caissuer - array of string for caIssuer value (i.e. CA certificates URL)</li> +1162 * </ul> +1163 * If there is no key usage extension in the certificate, +1164 * it returns null; +1165 * @example +1166 * oAIA = X509.getExtAIAInfo(hCert); +1167 * // result will be such like: +1168 * // oAIA.ocsp = ["http://ocsp.foo.com"]; +1169 * // oAIA.caissuer = ["http://rep.foo.com/aaa.p8m"]; +1170 */ +1171 X509.getExtAIAInfo = function(hCert) { +1172 var result = {}; +1173 result.ocsp = []; +1174 result.caissuer = []; +1175 var pos1 = X509.getPosOfTLV_V3ExtValue(hCert, "authorityInfoAccess"); +1176 if (pos1 == -1) return null; +1177 if (hCert.substr(pos1, 2) != "30") // extnValue SEQUENCE +1178 throw "malformed AIA Extn Value"; +1179 +1180 var posAccDescList = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pos1); +1181 for (var i = 0; i < posAccDescList.length; i++) { +1182 var p = posAccDescList[i]; +1183 var posAccDescChild = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, p); +1184 if (posAccDescChild.length != 2) +1185 throw "malformed AccessDescription of AIA Extn"; +1186 var pOID = posAccDescChild[0]; +1187 var pName = posAccDescChild[1]; +1188 if (ASN1HEX.getHexOfV_AtObj(hCert, pOID) == "2b06010505073001") { +1189 if (hCert.substr(pName, 2) == "86") { +1190 result.ocsp.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(hCert, pName))); +1191 } +1192 } +1193 if (ASN1HEX.getHexOfV_AtObj(hCert, pOID) == "2b06010505073002") { +1194 if (hCert.substr(pName, 2) == "86") { +1195 result.caissuer.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(hCert, pName))); +1196 } +1197 } +1198 } +1199 return result; +1200 }; +1201 +1202 /** +1203 * get signature algorithm name from hexadecimal certificate data +1204 * @name getSignatureAlgorithmName +1205 * @memberOf X509 +1206 * @function +1207 * @param {String} hCert hexadecimal string of X.509 certificate binary +1208 * @return {String} signature algorithm name (ex. SHA1withRSA, SHA256withECDSA) +1209 * @since x509 1.1.7 +1210 * @description +1211 * This method will get signature algorithm name of certificate: +1212 * @example +1213 * algName = X509.getSignatureAlgorithmName(hCert); +1214 */ +1215 X509.getSignatureAlgorithmName = function(hCert) { +1216 var sigAlgOidHex = ASN1HEX.getDecendantHexVByNthList(hCert, 0, [1, 0]); +1217 var sigAlgOidInt = KJUR.asn1.ASN1Util.oidHexToInt(sigAlgOidHex); +1218 var sigAlgName = KJUR.asn1.x509.OID.oid2name(sigAlgOidInt); +1219 return sigAlgName; +1220 }; +1221 +1222 /** +1223 * get signature value in hexadecimal string +1224 * @name getSignatureValueHex +1225 * @memberOf X509 +1226 * @function +1227 * @param {String} hCert hexadecimal string of X.509 certificate binary +1228 * @return {String} signature value hexadecimal string without BitString unused bits +1229 * @since x509 1.1.7 +1230 * @description +1231 * This method will get signature value of certificate: +1232 * @example +1233 * sigHex = X509.getSignatureValueHex(hCert); +1234 */ +1235 X509.getSignatureValueHex = function(hCert) { +1236 var h = ASN1HEX.getDecendantHexVByNthList(hCert, 0, [2]); +1237 if (h.substr(0, 2) !== "00") +1238 throw "can't get signature value"; +1239 return h.substr(2); +1240 }; +1241 +1242 X509.getSerialNumberHex = function(hCert) { +1243 return ASN1HEX.getDecendantHexVByNthList(hCert, 0, [0, 1]); +1244 }; +1245 +1246 /* +1247 X509.prototype.readCertPEM = _x509_readCertPEM; +1248 X509.prototype.readCertPEMWithoutRSAInit = _x509_readCertPEMWithoutRSAInit; +1249 X509.prototype.getSerialNumberHex = _x509_getSerialNumberHex; +1250 X509.prototype.getIssuerHex = _x509_getIssuerHex; +1251 X509.prototype.getSubjectHex = _x509_getSubjectHex; +1252 X509.prototype.getIssuerString = _x509_getIssuerString; +1253 X509.prototype.getSubjectString = _x509_getSubjectString; +1254 X509.prototype.getNotBefore = _x509_getNotBefore; +1255 X509.prototype.getNotAfter = _x509_getNotAfter; +1256 */ +1257 \ No newline at end of file diff --git a/asn1ocsp-1.0.js b/asn1ocsp-1.0.js new file mode 100755 index 00000000..f497f8ca --- /dev/null +++ b/asn1ocsp-1.0.js @@ -0,0 +1,425 @@ +/*! asn1ocsp-1.0.0.js (c) 2016 Kenji Urushima | kjur.github.com/jsrsasign/license + */ +/* + * asn1ocsp.js - ASN.1 DER encoder classes for OCSP protocol + * + * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) + * + * This software is licensed under the terms of the MIT License. + * http://kjur.github.com/jsrsasign/license + * + * The above copyright and license notice shall be + * included in all copies or substantial portions of the Software. + */ + +/** + * @fileOverview + * @name asn1ocsp-1.0.js + * @author Kenji Urushima kenji.urushima@gmail.com + * @version 1.0.0 (2016-Sep-22) + * @since jsrsasign 6.1.0 + * @license MIT License + */ + +if (typeof KJUR == "undefined" || !KJUR) KJUR = {}; +if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {}; + +/** + * ASN.1 classes for OCSP protocol
    + *

    + * This name space provides + * RFC 6960 + * Online Certificate Status Protocol (OCSP) ASN.1 request and response generator. + * + *

    FEATURES

    + * + * + *

    PROVIDED CLASSES

    + * + *

    + * @name KJUR.asn1.ocsp + * @namespace + */ +if (typeof KJUR.asn1.ocsp == "undefined" || !KJUR.asn1.ocsp) KJUR.asn1.ocsp = {}; + +KJUR.asn1.ocsp.DEFAULT_HASH = "sha1"; + +/** + * ASN.1 CertID class for OCSP
    + * @name KJUR.asn1.ocsp.CertID + * @class ASN.1 CertID class for OCSP + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * CertID ASN.1 class is defined in + * RFC 6960 4.1.1. + *
    + * CertID ::= SEQUENCE {
    + *   hashAlgorithm   AlgorithmIdentifier,
    + *   issuerNameHash  OCTET STRING, -- Hash of issuer's DN
    + *   issuerKeyHash   OCTET STRING, -- Hash of issuer's public key
    + *   serialNumber    CertificateSerialNumber }
    + * 
    + * @example + * // default constructor + * o = new KJUR.asn1.ocsp.CertID(); + * // constructor with certs (sha1 is used by default) + * o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."}); + * // constructor with certs and sha256 + * o = new KJUR.asn1.ocsp.CertID({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}); + * // constructor with values + * o = new KJUR.asn1.ocsp.CertID({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"}); + */ +KJUR.asn1.ocsp.CertID = function(params) { + KJUR.asn1.ocsp.CertID.superclass.constructor.call(this); + var nA = KJUR.asn1; + var nX = KJUR.asn1.x509; + this.dHashAlg = null; + this.dIssuerNameHash = null; + this.dIssuerKeyHash = null; + this.dSerialNumber = null; + + /** + * set CertID ASN.1 object by values.
    + * @name setByValue + * @memberOf KJUR.asn1.ocsp.CertID# + * @function + * @param {String} issuerNameHashHex hexadecimal string of hash value of issuer name + * @param {String} issuerKeyHashHex hexadecimal string of hash value of issuer public key + * @param {String} serialNumberHex hexadecimal string of certificate serial number to be verified + * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1 + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @example + * o = new KJUR.asn1.ocsp.CertID(); + * o.setByValue("1fac...", "fd3a...", "1234"); // sha1 is used by default + * o.setByValue("1fac...", "fd3a...", "1234", "sha256"); + */ + this.setByValue = function(issuerNameHashHex, issuerKeyHashHex, + serialNumberHex, algName) { + if (algName === undefined) + algName = KJUR.asn1.ocsp.DEFAULT_HASH; + this.dHashAlg = new nX.AlgorithmIdentifier({name: algName}); + this.dIssuerNameHash = new nA.DEROctetString({hex: issuerNameHashHex}); + this.dIssuerKeyHash = new nA.DEROctetString({hex: issuerKeyHashHex}); + this.dSerialNumber = new nA.DERInteger({hex: serialNumberHex}); + }; + + /** + * set CertID ASN.1 object by PEM certificates.
    + * @name setByCert + * @memberOf KJUR.asn1.ocsp.CertID# + * @function + * @param {String} issuerCert string of PEM issuer certificate + * @param {String} subjectCert string of PEM subject certificate to be verified by OCSP + * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1 + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @example + * o = new KJUR.asn1.ocsp.CertID(); + * o.setByCert("-----BEGIN...", "-----BEGIN..."); // sha1 is used by default + * o.setByCert("-----BEGIN...", "-----BEGIN...", "sha256"); + */ + this.setByCert = function(issuerCert, subjectCert, algName) { + if (algName === undefined) + algName = KJUR.asn1.ocsp.DEFAULT_HASH; + + var xSbj = new X509(); + xSbj.readCertPEM(subjectCert); + var xIss = new X509(); + xIss.readCertPEM(issuerCert); + var kiPropIss = X509.getPublicKeyInfoPropOfCertPEM(issuerCert); + var issuerKeyHex = kiPropIss.keyhex; + + var serialNumberHex = xSbj.getSerialNumberHex(); + var issuerNameHashHex = KJUR.crypto.Util.hashHex(xIss.getSubjectHex(), algName); + var issuerKeyHashHex = KJUR.crypto.Util.hashHex(issuerKeyHex, algName); + this.setByValue(issuerNameHashHex, issuerKeyHashHex, + serialNumberHex, algName); + this.hoge = xSbj.getSerialNumberHex(); + }; + + this.getEncodedHex = function() { + if (this.dHashAlg === null && + this.dIssuerNameHash === null && + this.dIssuerKeyHash === null && + this.dSerialNumber === null) + throw "not yet set values"; + + var a = [this.dHashAlg, this.dIssuerNameHash, + this.dIssuerKeyHash, this.dSerialNumber]; + var seq = new nA.DERSequence({array: a}); + this.hTLV = seq.getEncodedHex(); + return this.hTLV; + }; + + if (typeof params !== "undefined") { + var p = params; + if (typeof p.issuerCert !== "undefined" && + typeof p.subjectCert !== "undefined") { + var alg = KJUR.asn1.ocsp.DEFAULT_HASH; + if (typeof p.alg === "undefined") alg = undefined; + this.setByCert(p.issuerCert, p.subjectCert, alg); + } else if (typeof p.namehash !== "undefined" && + typeof p.keyhash !== "undefined" && + typeof p.serial !== "undefined") { + var alg = KJUR.asn1.ocsp.DEFAULT_HASH; + if (typeof p.alg === "undefined") alg = undefined; + this.setByValue(p.namehash, p.keyhash, p.serial, alg); + } else { + throw "invalid constructor arguments"; + } + } +}; +YAHOO.lang.extend(KJUR.asn1.ocsp.CertID, KJUR.asn1.ASN1Object); + +/** + * ASN.1 Request class for OCSP
    + * @name KJUR.asn1.ocsp.Request + * @class ASN.1 Request class for OCSP + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * Request ASN.1 class is defined in + * RFC 6960 4.1.1. + * singleRequestExtensions is not supported yet in this version such as nonce. + *
    + * Request ::= SEQUENCE {
    + *   reqCert                  CertID,
    + *   singleRequestExtensions  [0] EXPLICIT Extensions OPTIONAL }
    + * 
    + * @example + * // default constructor + * o = new KJUR.asn1.ocsp.Request(); + * // constructor with certs (sha1 is used by default) + * o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN..."}); + * // constructor with certs and sha256 + * o = new KJUR.asn1.ocsp.Request({issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"}); + * // constructor with values + * o = new KJUR.asn1.ocsp.Request({namehash: "1a...", keyhash: "ad...", serial: "1234", alg: "sha256"}); + */ +KJUR.asn1.ocsp.Request = function(params) { + KJUR.asn1.ocsp.Request.superclass.constructor.call(this); + this.dReqCert = null; + this.dExt = null; + + this.getEncodedHex = function() { + var a = []; + + // 1. reqCert + if (this.dReqCert === null) + throw "reqCert not set"; + a.push(this.dReqCert); + + // 2. singleRequestExtensions (not supported yet) + + // 3. construct SEQUENCE + var seq = new KJUR.asn1.DERSequence({array: a}); + this.hTLV = seq.getEncodedHex(); + return this.hTLV; + }; + + if (typeof params !== "undefined") { + var o = new KJUR.asn1.ocsp.CertID(params); + this.dReqCert = o; + } +}; +YAHOO.lang.extend(KJUR.asn1.ocsp.Request, KJUR.asn1.ASN1Object); + +/** + * ASN.1 TBSRequest class for OCSP
    + * @name KJUR.asn1.ocsp.TBSRequest + * @class ASN.1 TBSRequest class for OCSP + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * TBSRequest ASN.1 class is defined in + * RFC 6960 4.1.1. + *
    + * TBSRequest ::= SEQUENCE {
    + *   version            [0] EXPLICIT Version DEFAULT v1,
    + *   requestorName      [1] EXPLICIT GeneralName OPTIONAL,
    + *   requestList            SEQUENCE OF Request,
    + *   requestExtensions  [2] EXPLICIT Extensions OPTIONAL }
    + * 
    + * @example + * // default constructor + * o = new KJUR.asn1.ocsp.TBSRequest(); + * // constructor with requestList parameter + * o = new KJUR.asn1.ocsp.TBSRequest({reqList:[ + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:}, + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"} + * ]}); + */ +KJUR.asn1.ocsp.TBSRequest = function(params) { + KJUR.asn1.ocsp.TBSRequest.superclass.constructor.call(this); + this.version = 0; + this.dRequestorName = null; + this.dRequestList = []; + this.dRequestExt = null; + + /** + * set TBSRequest ASN.1 object by array of parameters.
    + * @name setRequestListByParam + * @memberOf KJUR.asn1.ocsp.TBSRequest# + * @function + * @param {Array} aParams array of parameters for Request class + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @example + * o = new KJUR.asn1.ocsp.TBSRequest(); + * o.setRequestListByParam([ + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:}, + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"} + * ]); + */ + this.setRequestListByParam = function(aParams) { + var a = []; + for (var i = 0; i < aParams.length; i++) { + var dReq = new KJUR.asn1.ocsp.Request(aParams[0]); + a.push(dReq); + } + this.dRequestList = a; + }; + + this.getEncodedHex = function() { + var a = []; + + // 1. version + if (this.version !== 0) + throw "not supported version: " + this.version; + + // 2. requestorName + if (this.dRequestorName !== null) + throw "requestorName not supported"; + + // 3. requestList + var seqRequestList = + new KJUR.asn1.DERSequence({array: this.dRequestList}); + a.push(seqRequestList); + + // 4. requestExtensions + if (this.dRequestExt !== null) + throw "requestExtensions not supported"; + + // 5. construct SEQUENCE + var seq = new KJUR.asn1.DERSequence({array: a}); + this.hTLV = seq.getEncodedHex(); + return this.hTLV; + }; + + if (typeof params !== "undefined") { + if (typeof params.reqList !== "undefined") + this.setRequestListByParam(params.reqList); + } +}; +YAHOO.lang.extend(KJUR.asn1.ocsp.TBSRequest, KJUR.asn1.ASN1Object); + + +/** + * ASN.1 OCSPRequest class for OCSP
    + * @name KJUR.asn1.ocsp.OCSPRequest + * @class ASN.1 OCSPRequest class for OCSP + * @param {Array} params associative array of parameters + * @extends KJUR.asn1.ASN1Object + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * OCSPRequest ASN.1 class is defined in + * RFC 6960 4.1.1. + * A signed request is not supported yet in this version. + *
    + * OCSPRequest ::= SEQUENCE {
    + *   tbsRequest             TBSRequest,
    + *   optionalSignature  [0] EXPLICIT Signature OPTIONAL }
    + * 
    + * @example + * // default constructor + * o = new KJUR.asn1.ocsp.OCSPRequest(); + * // constructor with requestList parameter + * o = new KJUR.asn1.ocsp.OCSPRequest({reqList:[ + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg:}, + * {issuerCert: "-----BEGIN...", subjectCert: "-----BEGIN...", alg: "sha256"} + * ]}); + */ +KJUR.asn1.ocsp.OCSPRequest = function(params) { + KJUR.asn1.ocsp.OCSPRequest.superclass.constructor.call(this); + this.dTbsRequest = null; + this.dOptionalSignature = null; + + this.getEncodedHex = function() { + var a = []; + + // 1. tbsRequest + if (this.dTbsRequest !== null) { + a.push(this.dTbsRequest); + } else { + throw "tbsRequest not set"; + } + + // 2. optionalSignature + if (this.dOptionalSignature !== null) + throw "optionalSignature not supported"; + + // 3. construct SEQUENCE + var seq = new KJUR.asn1.DERSequence({array: a}); + this.hTLV = seq.getEncodedHex(); + return this.hTLV; + }; + + if (typeof params !== "undefined") { + if (typeof params.reqList !== "undefined") { + var o = new KJUR.asn1.ocsp.TBSRequest(params); + this.dTbsRequest = o; + } + } +}; +YAHOO.lang.extend(KJUR.asn1.ocsp.OCSPRequest, KJUR.asn1.ASN1Object); + +/** + * Utility class for OCSP
    + * @name KJUR.asn1.ocsp.OCSPUtil + * @class Utility class for OCSP + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * This class provides utility static methods for OCSP. + * + */ +KJUR.asn1.ocsp.OCSPUtil = {}; + +/** + * generates hexadecimal string of OCSP request
    + * @name getRequestHex + * @memberOf KJUR.asn1.ocsp.OCSPUtil + * @function + * @param {String} issuerCert string of PEM issuer certificate + * @param {String} subjectCert string of PEM subject certificate to be verified by OCSP + * @param {String} algName hash algorithm name used for above arguments (ex. "sha1") DEFAULT: sha1 + * @return {String} hexadecimal string of generated OCSP request + * @since jsrsasign 6.1.0 asn1ocsp 1.0.0 + * @description + * This static method generates hexadecimal string of OCSP request. + * @example + * // generate OCSP request using sha1 algorithnm by default. + * hReq = KJUR.asn1.ocsp.OCSPUtil.getRequestHex("-----BEGIN...", "-----BEGIN..."); + */ +KJUR.asn1.ocsp.OCSPUtil.getRequestHex = function(issuerCert, subjectCert, alg) { + if (alg === undefined) alg = KJUR.asn1.ocsp.DEFAULT_HASH; + var param = {alg: alg, issuerCert: issuerCert, subjectCert: subjectCert}; + var o = new KJUR.asn1.ocsp.OCSPRequest({reqList: [param]}); + return o.getEncodedHex(); +}; + diff --git a/asn1x509-1.0.js b/asn1x509-1.0.js index ba990f69..7fd42fa6 100644 --- a/asn1x509-1.0.js +++ b/asn1x509-1.0.js @@ -1520,6 +1520,7 @@ YAHOO.lang.extend(KJUR.asn1.x509.Time, KJUR.asn1.ASN1Object); * @extends KJUR.asn1.ASN1Object * @description * @example + * algId1 = new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"}); */ KJUR.asn1.x509.AlgorithmIdentifier = function(params) { KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this); diff --git a/bower.json b/bower.json index a035898f..6998a6d9 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "kjur-jsrsasign", - "version": "6.0.1", + "version": "6.1.0", "main": "jsrsasign-latest-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 CMS SignedData, TimeStamp, CAdES, JWS and JWT in pure JavaScript.", + "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", "ignore": [ ".jshintrc" diff --git a/index.html b/index.html index ff282c0b..f826f443 100755 --- a/index.html +++ b/index.html @@ -69,6 +69,12 @@

    FEATURES

    NEWS

    +
    2016-Sep-24: +
    +Release 6.1.0 is now available. +RFC 6960 +start to add OCSP protocol support. +
    2016-Sep-11:
    Release 6.0.0 is now available. diff --git a/jsrsasign-latest-all-min.js b/jsrsasign-latest-all-min.js index 03ec3809..8de24ab4 100644 --- a/jsrsasign-latest-all-min.js +++ b/jsrsasign-latest-all-min.js @@ -1,5 +1,5 @@ /* - * jsrsasign 6.0.1 (2016-09-12) (c) 2010-2016 Kenji Urushima | kjur.github.com/jsrsasign/license + * jsrsasign 6.1.0 (2016-09-24) (c) 2010-2016 Kenji Urushima | kjur.github.com/jsrsasign/license */ /* @@ -248,6 +248,9 @@ if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!K /*! asn1csr-1.0.0.js (c) 2015 Kenji Urushima | kjur.github.com/jsrsasign/license */ if(typeof KJUR.asn1.csr=="undefined"||!KJUR.asn1.csr){KJUR.asn1.csr={}}KJUR.asn1.csr.CertificationRequest=function(f){KJUR.asn1.csr.CertificationRequest.superclass.constructor.call(this);var b=null;var d=null;var e=null;var c=null;var a=null;this.sign=function(i,h){if(this.prvKey==null){this.prvKey=h}this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier({name:i});sig=new KJUR.crypto.Signature({alg:i});sig.initSign(this.prvKey);sig.updateHex(this.asn1CSRInfo.getEncodedHex());this.hexSig=sig.sign();this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var g=new KJUR.asn1.DERSequence({array:[this.asn1CSRInfo,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=g.getEncodedHex();this.isModified=false};this.getPEMString=function(){var g=KJUR.asn1.ASN1Util.getPEMStringFromHex(this.getEncodedHex(),"CERTIFICATE REQUEST");return g};this.getEncodedHex=function(){if(this.isModified==false&&this.hTLV!=null){return this.hTLV}throw"not signed yet"};if(typeof f!="undefined"){if(typeof f.csrinfo!="undefined"){this.asn1CSRInfo=f.csrinfo}}};YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequest,KJUR.asn1.ASN1Object);KJUR.asn1.csr.CertificationRequestInfo=function(a){KJUR.asn1.csr.CertificationRequestInfo.superclass.constructor.call(this);this._initialize=function(){this.asn1Array=new Array();this.asn1Version=new KJUR.asn1.DERInteger({"int":0});this.asn1Subject=null;this.asn1SubjPKey=null;this.extensionsArray=new Array()};this.setSubjectByParam=function(b){this.asn1Subject=new KJUR.asn1.x509.X500Name(b)};this.setSubjectPublicKeyByGetKey=function(c){var b=KEYUTIL.getKey(c);this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(b)};this.getEncodedHex=function(){this.asn1Array=new Array();this.asn1Array.push(this.asn1Version);this.asn1Array.push(this.asn1Subject);this.asn1Array.push(this.asn1SubjPKey);var c=new KJUR.asn1.DERSequence({array:this.extensionsArray});var b=new KJUR.asn1.DERTaggedObject({explicit:false,tag:"a0",obj:c});this.asn1Array.push(b);var d=new KJUR.asn1.DERSequence({array:this.asn1Array});this.hTLV=d.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequestInfo,KJUR.asn1.ASN1Object);KJUR.asn1.csr.CSRUtil=new function(){};KJUR.asn1.csr.CSRUtil.newCSRPEM=function(f){var c=KJUR.asn1.csr;if(f.subject===undefined){throw"parameter subject undefined"}if(f.sbjpubkey===undefined){throw"parameter sbjpubkey undefined"}if(f.sigalg===undefined){throw"parameter sigalg undefined"}if(f.sbjprvkey===undefined){throw"parameter sbjpubkey undefined"}var b=new c.CertificationRequestInfo();b.setSubjectByParam(f.subject);b.setSubjectPublicKeyByGetKey(f.sbjpubkey);var d=new c.CertificationRequest({csrinfo:b});var a=KEYUTIL.getKey(f.sbjprvkey);d.sign(f.sigalg,a);var e=d.getPEMString();return e}; +/*! asn1ocsp-1.0.0.js (c) 2016 Kenji Urushima | kjur.github.com/jsrsasign/license + */ +if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}if(typeof KJUR.asn1.ocsp=="undefined"||!KJUR.asn1.ocsp){KJUR.asn1.ocsp={}}KJUR.asn1.ocsp.DEFAULT_HASH="sha1";KJUR.asn1.ocsp.CertID=function(c){KJUR.asn1.ocsp.CertID.superclass.constructor.call(this);var a=KJUR.asn1;var e=KJUR.asn1.x509;this.dHashAlg=null;this.dIssuerNameHash=null;this.dIssuerKeyHash=null;this.dSerialNumber=null;this.setByValue=function(i,h,f,g){if(g===undefined){g=KJUR.asn1.ocsp.DEFAULT_HASH}this.dHashAlg=new e.AlgorithmIdentifier({name:g});this.dIssuerNameHash=new a.DEROctetString({hex:i});this.dIssuerKeyHash=new a.DEROctetString({hex:h});this.dSerialNumber=new a.DERInteger({hex:f})};this.setByCert=function(m,i,k){if(k===undefined){k=KJUR.asn1.ocsp.DEFAULT_HASH}var f=new X509();f.readCertPEM(i);var n=new X509();n.readCertPEM(m);var o=X509.getPublicKeyInfoPropOfCertPEM(m);var l=o.keyhex;var g=f.getSerialNumberHex();var h=KJUR.crypto.Util.hashHex(n.getSubjectHex(),k);var j=KJUR.crypto.Util.hashHex(l,k);this.setByValue(h,j,g,k);this.hoge=f.getSerialNumberHex()};this.getEncodedHex=function(){if(this.dHashAlg===null&&this.dIssuerNameHash===null&&this.dIssuerKeyHash===null&&this.dSerialNumber===null){throw"not yet set values"}var f=[this.dHashAlg,this.dIssuerNameHash,this.dIssuerKeyHash,this.dSerialNumber];var g=new a.DERSequence({array:f});this.hTLV=g.getEncodedHex();return this.hTLV};if(typeof c!=="undefined"){var b=c;if(typeof b.issuerCert!=="undefined"&&typeof b.subjectCert!=="undefined"){var d=KJUR.asn1.ocsp.DEFAULT_HASH;if(typeof b.alg==="undefined"){d=undefined}this.setByCert(b.issuerCert,b.subjectCert,d)}else{if(typeof b.namehash!=="undefined"&&typeof b.keyhash!=="undefined"&&typeof b.serial!=="undefined"){var d=KJUR.asn1.ocsp.DEFAULT_HASH;if(typeof b.alg==="undefined"){d=undefined}this.setByValue(b.namehash,b.keyhash,b.serial,d)}else{throw"invalid constructor arguments"}}}};YAHOO.lang.extend(KJUR.asn1.ocsp.CertID,KJUR.asn1.ASN1Object);KJUR.asn1.ocsp.Request=function(b){KJUR.asn1.ocsp.Request.superclass.constructor.call(this);this.dReqCert=null;this.dExt=null;this.getEncodedHex=function(){var c=[];if(this.dReqCert===null){throw"reqCert not set"}c.push(this.dReqCert);var d=new KJUR.asn1.DERSequence({array:c});this.hTLV=d.getEncodedHex();return this.hTLV};if(typeof b!=="undefined"){var a=new KJUR.asn1.ocsp.CertID(b);this.dReqCert=a}};YAHOO.lang.extend(KJUR.asn1.ocsp.Request,KJUR.asn1.ASN1Object);KJUR.asn1.ocsp.TBSRequest=function(a){KJUR.asn1.ocsp.TBSRequest.superclass.constructor.call(this);this.version=0;this.dRequestorName=null;this.dRequestList=[];this.dRequestExt=null;this.setRequestListByParam=function(d){var b=[];for(var c=0;ca.length){d=a.length}for(var b=0;ba.length){d=a.length}for(var b=0;bqunit-do-asn1csr.html
  • qunit-do-asn1hex-dump.html
  • qunit-do-asn1hex.html
  • +
  • qunit-do-asn1ocsp.html
  • qunit-do-asn1tsp.html
  • qunit-do-asn1x509-newcrt.html
  • qunit-do-asn1x509.html
  • diff --git a/test/qunit-do-asn1.html b/test/qunit-do-asn1.html index b24fa28c..64602c2a 100755 --- a/test/qunit-do-asn1.html +++ b/test/qunit-do-asn1.html @@ -46,7 +46,6 @@ test("Integer Test", function() { var d = new KJUR.asn1.DERInteger(); - expect(9); d.setByBigInteger(new BigInteger("3", 16)); equal(d.getEncodedHex(), "020103", "setByBigInteger(BI('3',16))"); d.setByBigInteger(new BigInteger("3f", 16)); @@ -65,6 +64,8 @@ equal(d3.getEncodedHex(), "0201fd", "constructor int -3"); var d4 = new KJUR.asn1.DERInteger({'hex': 'fd'}); equal(d4.getEncodedHex(), "0201fd", "constructor hex fd"); + var d5 = new KJUR.asn1.DERInteger({'hex': '00fd'}); + equal(d5.getEncodedHex(), "020200fd", "constructor hex 00fd"); }); test("BitString Test", function() { @@ -302,5 +303,7 @@
    test markup
    +TEST INDEX | +API | diff --git a/test/qunit-do-asn1ocsp.html b/test/qunit-do-asn1ocsp.html new file mode 100755 index 00000000..a3331e5b --- /dev/null +++ b/test/qunit-do-asn1ocsp.html @@ -0,0 +1,216 @@ + + + + +QUnit for OCSP request/response ASN1 Encoder Class 'asn1ocsp.js' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    test markup
    +TEST INDEX | +API | + + + diff --git a/x509-1.1.js b/x509-1.1.js index b084046c..d61aec44 100644 --- a/x509-1.1.js +++ b/x509-1.1.js @@ -408,6 +408,16 @@ X509.pemToHex = function(sCertPEM) { return hCert; }; +/** + * get a string index of contents of subjectPublicKeyInfo BITSTRING value from hexadecimal certificate
    + * @name getSubjectPublicKeyPosFromCertHex + * @memberOf X509 + * @function + * @param {String} hexadecimal string of DER RSA/ECDSA/DSA X.509 certificate + * @return {Integer} string index of key contents + * @example + * idx = X509.getSubjectPublicKeyPosFromCertHex("3082..."); + */ // NOTE: Without BITSTRING encapsulation. X509.getSubjectPublicKeyPosFromCertHex = function(hCert) { var pInfo = X509.getSubjectPublicKeyInfoPosFromCertHex(hCert); @@ -422,8 +432,20 @@ X509.getSubjectPublicKeyPosFromCertHex = function(hCert) { return pBitStringV + 2; }; -// NOTE: privateKeyUsagePeriod field of X509v2 not supported. -// NOTE: v1 and v3 supported +/** + * get a string index of subjectPublicKeyInfo field from hexadecimal certificate
    + * @name getSubjectPublicKeyInfoPosFromCertHex + * @memberOf X509 + * @function + * @param {String} hexadecimal string of DER RSA/ECDSA/DSA X.509 certificate + * @return {Integer} string index of subjectPublicKeyInfo field + * @description + * This static method gets a string index of subjectPublicKeyInfo field from hexadecimal certificate.
    + * NOTE1: privateKeyUsagePeriod field of X509v2 not supported.
    + * NOTE2: X.509v1 and X.509v3 certificate are supported.
    + * @example + * idx = X509.getSubjectPublicKeyInfoPosFromCertHex("3082..."); + */ X509.getSubjectPublicKeyInfoPosFromCertHex = function(hCert) { var pTbsCert = ASN1HEX.getStartPosOfV_AtObj(hCert, 0); var a = ASN1HEX.getPosArrayOfChildren_AtObj(hCert, pTbsCert);