@types/jsrsasign
Advanced tools
Comparing version 8.0.13 to 9.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for jsrsasign 8.0 | ||
// Type definitions for jsrsasign 9.0 | ||
// Project: https://github.com/kjur/jsrsasign | ||
@@ -3,0 +3,0 @@ // Definitions by: Florian Imdahl <https://github.com/ffflorian> |
@@ -13,2 +13,10 @@ declare namespace jsrsasign.KJUR.asn1.csr { | ||
interface ParamResponse { | ||
subject: { array?: IdentityResponse }; | ||
sbjpubkey: string; | ||
extreq?: Array<{ extname: string; array?: any[] }>; | ||
sigalg: string; | ||
sighex: string; | ||
} | ||
/** | ||
@@ -107,3 +115,39 @@ * Certification Request (CSR/PKCS#10) utilities class | ||
function getInfo(sPEM: string): PEMInfo; | ||
/** | ||
* get field values from CSR/PKCS#10 PEM string | ||
* @param sPEM PEM string of CSR/PKCS#10 | ||
* @returns JSON object with parsed parameters such as name or public key | ||
* @description | ||
* This method parses PEM CSR/PKCS#1 string and retrieves | ||
* fields such as subject name and public key. | ||
* Following parameters are available in the | ||
* resulted JSON object. | ||
* | ||
* - {X500Name}subject - subject name parameters | ||
* - {String}sbjpubkey - PEM string of subject public key | ||
* - {Array}extreq - array of extensionRequest parameters | ||
* - {String}sigalg - name of signature algorithm field | ||
* - {String}sighex - hexadecimal string of signature value | ||
* | ||
* Returned JSON object can be passed to | ||
* {@link KJUR.asn1.csr.CertificationRequest} class constructor. | ||
* | ||
* CAUTION: | ||
* Returned JSON value format have been changed without | ||
* backward compatibility since jsrsasign 9.0.0 asn1csr 2.0.0. | ||
* | ||
* @example | ||
* KJUR.asn1.csr.CSRUtil.getParam("-----BEGIN CERTIFICATE REQUEST...") → | ||
* { | ||
* subject: { array:[[{type:"C",value:"JP",ds:"prn"}],...], | ||
* str: "/C=JP/O=Test"}, | ||
* sbjpubkey: "-----BEGIN PUBLIC KEY...", | ||
* extreq: [{extname:"subjectAltName",array:[{dns:"example.com"}]}] | ||
* sigalg: "SHA256withRSA", | ||
* sighex: "1ab3df.." | ||
* } | ||
*/ | ||
function getParam(sPEM: string): ParamResponse; | ||
} | ||
} |
@@ -49,9 +49,13 @@ declare namespace jsrsasign.KJUR.asn1.x509 { | ||
* @return PEM formatted string of certificate | ||
* @since jsrsasign 9.0.0 asn1hex 2.0.0 | ||
* @description | ||
* This method returns a string of PEM formatted | ||
* certificate. | ||
* @example | ||
* var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': prvKey}); | ||
* cert.sign(); | ||
* var sPEM = cert.getPEMString(); | ||
* cert = new KJUR.asn1.x509.Certificate({...}); | ||
* cert.getPEM() → | ||
* "-----BEGIN CERTIFICATE-----\r\n..." | ||
*/ | ||
getPEMString(): string; | ||
getPEM(): string; | ||
} | ||
} |
@@ -94,3 +94,3 @@ declare namespace jsrsasign.KJUR.crypto { | ||
*/ | ||
digest(): void; | ||
digest(): string; | ||
@@ -104,3 +104,3 @@ /** | ||
*/ | ||
digestString(str: string): void; | ||
digestString(str: string): string; | ||
@@ -114,3 +114,3 @@ /** | ||
*/ | ||
digestHex(hex: string): void; | ||
digestHex(hex: string): string; | ||
@@ -117,0 +117,0 @@ /** |
@@ -237,4 +237,4 @@ declare namespace jsrsasign.KJUR.jws { | ||
sJWS: string, | ||
key: string, | ||
acceptAlgs?: string[] | { b64: string } | { hex: string } | { utf8: string }, | ||
key: string | RSAKey | crypto.ECDSA | { b64: string } | { hex: string } | { utf8: string } | { rstr: string } | { b64u: string }, | ||
acceptAlgs?: string[], | ||
): boolean; | ||
@@ -241,0 +241,0 @@ |
@@ -8,2 +8,18 @@ declare namespace jsrsasign { | ||
interface IdentityResponse { | ||
array: Array<[{ type: string; value: string; ds: string }]>; | ||
str: string; | ||
} | ||
interface Hex { | ||
hex: string; | ||
} | ||
interface AuthorityKeyIdentifierResult { | ||
kid?: Hex; | ||
issuer?: Hex; | ||
sn?: Hex; | ||
critical?: boolean; | ||
} | ||
interface PublicKeyInfoPropOfCertPEMResult { | ||
@@ -65,2 +81,13 @@ /** hexadecimal string of OID of asymmetric key algorithm */ | ||
/** | ||
* get JSON object of issuer field | ||
* @return IdentityResponse JSON object of issuer field | ||
* @example | ||
* var x = new X509(sCertPEM); | ||
* x.getIssuer() → | ||
* { array: [[{type:'C',value:'JP',ds:'prn'}],...], | ||
* str: "/C=JP/..." } | ||
*/ | ||
getIssuer(): IdentityResponse; | ||
/** | ||
* get hexadecimal string of issuer field TLV of certificate. | ||
@@ -86,2 +113,13 @@ * @return hexadecial string of issuer DN ASN.1 | ||
/** | ||
* get JSON object of subject field | ||
* @return IdentityResponse JSON object of subject field | ||
* @example | ||
* var x = new X509(sCertPEM); | ||
* x.getSubject() → | ||
* { array: [[{type:'C',value:'JP',ds:'prn'}],...], | ||
* str: "/C=JP/..." } | ||
*/ | ||
getSubject(): IdentityResponse; | ||
/** | ||
* get hexadecimal string of subject field of certificate. | ||
@@ -246,15 +284,18 @@ * @return hexadecial string of subject DN ASN.1 | ||
* get BasicConstraints extension value as object in the certificate | ||
* @return associative array which may have "cA" and "pathLen" parameters | ||
* @param hExtV hexadecimal string of extension value (OPTIONAL) | ||
* @param critical flag (OPTIONAL) | ||
* @return JSON object of BasicConstraints parameter or undefined | ||
* @description | ||
* This method will get basic constraints extension value as object with following paramters. | ||
* | ||
* - cA - CA flag whether CA or not | ||
* - pathLen - maximum intermediate certificate length | ||
* - {Boolean}cA - CA flag whether CA or not | ||
* - {Integer}pathLen - maximum intermediate certificate length | ||
* - {Boolean}critical - critical flag | ||
* | ||
* There are use cases for return values: | ||
* | ||
* - {cA:true, pathLen:3} - cA flag is true and pathLen is 3 | ||
* - {cA:true} - cA flag is true and no pathLen | ||
* - {cA:true,pathLen:3,critical:true} - cA flag is true and pathLen is 3 | ||
* - {cA:true,critical:true} - cA flag is true and no pathLen | ||
* - {} - basic constraints has no value in case of end entity certificate | ||
* - undefined - there is no basic constraints extension | ||
* undefined - there is no basic constraints extension | ||
* | ||
@@ -264,5 +305,5 @@ * @example | ||
* x.readCertPEM(sCertPEM); // parseExt() will also be called internally. | ||
* x.getExtBasicConstraints() → { cA: true, pathLen: 3 }; | ||
* x.getExtBasicConstraints() → {cA:true,pathLen:3,critical:true} | ||
*/ | ||
getExtBasicConstraints(): { cA: boolean; pathLen: number }; | ||
getExtBasicConstraints(hExtV?: string, critical?: boolean): { cA: boolean; pathLen: number; critical?: boolean; extname?: string }; | ||
@@ -305,31 +346,74 @@ /** | ||
* get subjectKeyIdentifier value as hexadecimal string in the certificate | ||
* @return hexadecimal string of subject key identifier or null | ||
* @return JSON object of SubjectKeyIdentifier parameter or undefined | ||
* @description | ||
* This method will get subject key identifier extension value | ||
* as hexadecimal string. | ||
* If there is this in the certificate, it returns undefined; | ||
* This method will get | ||
* {@link https://tools.ietf.org/html/rfc5280#section-4.2.1.2 SubjectKeyIdentifier extension} value as JSON object. | ||
* | ||
* When hExtV and critical specified as arguments, return value | ||
* will be generated from them. | ||
* If there is no such extension in the certificate, it returns undefined. | ||
* | ||
* Result of this method can be passed to | ||
* {@link https://kjur.github.io/jsrsasign/api/symbols/KJUR.asn1.x509.SubjectKeyIdentifier.html KJUR.asn1.x509.SubjectKeyIdentifier} constructor. | ||
* <pre> | ||
* id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 } | ||
* SubjectKeyIdentifier ::= KeyIdentifier | ||
* </pre> | ||
* | ||
* CAUTION: | ||
* Returned JSON value format has been changed without | ||
* backward compatibility since jsrsasign 9.0.0 x509 2.0.0. | ||
* | ||
* @example | ||
* x = new X509(); | ||
* x.readCertPEM(sCertPEM); // parseExt() will also be called internally. | ||
* x.getExtSubjectKeyIdentifier() → "1b3347ab..."; | ||
* x.getExtSubjectKeyIdentifier() → | ||
* { kid: {hex: "1b3347ab..."}, critical: true }; | ||
*/ | ||
getExtSubjectKeyIdentifier(): string; | ||
getExtSubjectKeyIdentifier(hExtV?: string, critical?: boolean): { extname: string; kid: Hex ; critical?: boolean }; | ||
/** | ||
* get authorityKeyIdentifier value as JSON object in the certificate | ||
* @return JSON object of authority key identifier or null | ||
* @param hExtV hexadecimal string of extension value (OPTIONAL) | ||
* @param critical flag (OPTIONAL) | ||
* @return JSON object of AuthorityKeyIdentifier parameter or undefined | ||
* @description | ||
* This method will get authority key identifier extension value | ||
* as JSON object. | ||
* If there is this in the certificate, it returns undefined; | ||
* This method will get | ||
* {@link getExtAuthorityKeyIdentifier https://tools.ietf.org/html/rfc5280#section-4.2.1.1} | ||
* value as JSON object. | ||
* | ||
* NOTE: Currently this method only supports keyIdentifier so that | ||
* authorityCertIssuer and authorityCertSerialNumber will not | ||
* be return in the JSON object. | ||
* When hExtV and critical specified as arguments, return value | ||
* will be generated from them. | ||
* If there is no such extension in the certificate, it returns undefined. | ||
* | ||
* Result of this method can be passed to | ||
* {@link KJUR.asn1.x509.AuthorityKeyIdentifier} constructor. | ||
* | ||
* id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 } | ||
* AuthorityKeyIdentifier ::= SEQUENCE { | ||
* keyIdentifier [0] KeyIdentifier OPTIONAL, | ||
* authorityCertIssuer [1] GeneralNames OPTIONAL, | ||
* authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL } | ||
* KeyIdentifier ::= OCTET STRING | ||
* | ||
* Constructor may have following parameters: | ||
* | ||
* - {Array}kid - JSON object of {@link KJUR.asn1.DEROctetString} parameters | ||
* - {Array}issuer - JSON object of {@link KJUR.asn1.x509.X500Name} parameters | ||
* - {Array}sn - JSON object of {@link KJUR.asn1.DERInteger} parameters | ||
* - {Boolean}critical - critical flag | ||
* | ||
* | ||
* NOTE: The 'authorityCertIssuer' and 'authorityCertSerialNumber' | ||
* supported since jsrsasign 9.0.0 x509 2.0.0. | ||
* @example | ||
* x = new X509(); | ||
* x.readCertPEM(sCertPEM); // parseExt() will also be called internally. | ||
* x.getExtAuthorityKeyIdentifier() → { kid: "1234abcd..." } | ||
* x.readCertPEM(sCertPEM); | ||
* x.getExtAuthorityKeyIdentifier() → | ||
* { kid: {hex: "1234abcd..."}, | ||
* issuer: {hex: "30..."}, | ||
* sn: {hex: "1234..."}, | ||
* critical: true} | ||
*/ | ||
getExtAuthorityKeyIdentifier(): { kid: string } | null; | ||
getExtAuthorityKeyIdentifier(hExtV?: string, critical?: boolean): AuthorityKeyIdentifierResult; | ||
@@ -336,0 +420,0 @@ /** |
{ | ||
"name": "@types/jsrsasign", | ||
"version": "8.0.13", | ||
"version": "9.0.0", | ||
"description": "TypeScript definitions for jsrsasign", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsrsasign", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "5b10fefed761392445470c02e3444db949ffe98082752aa850fc0d24f6df199a", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "a2a948a3fe0ed578a196b515ed8bc154dd57114d5c41d39d8734b61f37e3af3b", | ||
"typeScriptVersion": "3.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 08 Jul 2021 16:22:58 GMT | ||
* Last updated: Wed, 29 Dec 2021 08:01:22 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `jsrsasign`, `lang` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304949
7298