Function
| Static Public Summary | ||
| public |
createCMSECDSASignature(signatureBuffer: ArrayBuffer): ArrayBuffer Create CMS ECDSA signature from WebCrypto ECDSA signature |
|
| public |
createECDSASignatureFromCMS(cmsSignature: Sequence): ArrayBuffer Create a single ArrayBuffer from CMS ECDSA signature |
|
| public |
getAlgorithmByOID(oid: string): Object Get WebCrypto algorithm by wel-known OID |
|
| public |
getAlgorithmParameters(algorithmName: string, operation: string): * Get default algorithm parameters for each kind of operation |
|
| public |
Get crypto subtle from current "crypto engine" or "undefined" |
|
| public |
getEngine(): * |
|
| public |
getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string Getting hash algorithm by signature algorithm |
|
| public |
getOIDByAlgorithm(algorithm: Object): string Get OID for each specific algorithm |
|
| public |
getRandomValues(view: Uint8Array): * Initialize input Uint8Array by random values (with help from current "crypto engine") |
|
| public |
kdf(hashFunction: string, Zbuffer: ArrayBuffer, keydatalen: number, SharedInfo: ArrayBuffer): * ANS X9.63 Key Derivation Function |
|
| public |
kdfWithCounter(hashFunction: string, Zbuffer: ArrayBuffer, Counter: number, SharedInfo: ArrayBuffer): * ANS X9.63 Key Derivation Function having a "Counter" as a parameter |
|
| public |
setEngine(name: *, crypto: *, subtle: *) |
|
| public |
stringPrep(inputString: string): string String preparation function. |
|
| public |
async verifySCTsForCertificate(certificate: Certificate, issuerCertificate: Certificate, logs: Object[], index: Number): Array Verify SignedCertificateTimestamp for specific certificate content |
|
Static Public
public createCMSECDSASignature(signatureBuffer: ArrayBuffer): ArrayBuffer source
import {createCMSECDSASignature} from 'pkijs/src/common.js'Create CMS ECDSA signature from WebCrypto ECDSA signature
Params:
| Name | Type | Attribute | Description |
| signatureBuffer | ArrayBuffer | WebCrypto result of "sign" function |
public createECDSASignatureFromCMS(cmsSignature: Sequence): ArrayBuffer source
import {createECDSASignatureFromCMS} from 'pkijs/src/common.js'Create a single ArrayBuffer from CMS ECDSA signature
Params:
| Name | Type | Attribute | Description |
| cmsSignature | Sequence | ASN.1 SEQUENCE contains CMS ECDSA signature |
public getAlgorithmByOID(oid: string): Object source
import {getAlgorithmByOID} from 'pkijs/src/common.js'Get WebCrypto algorithm by wel-known OID
Params:
| Name | Type | Attribute | Description |
| oid | string | well-known OID to search for |
public getAlgorithmParameters(algorithmName: string, operation: string): * source
import {getAlgorithmParameters} from 'pkijs/src/common.js'Get default algorithm parameters for each kind of operation
Return:
| * |
public getCrypto(): * | null source
import {getCrypto} from 'pkijs/src/common.js'Get crypto subtle from current "crypto engine" or "undefined"
public getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string source
import {getHashAlgorithm} from 'pkijs/src/common.js'Getting hash algorithm by signature algorithm
Params:
| Name | Type | Attribute | Description |
| signatureAlgorithm | AlgorithmIdentifier | Signature algorithm |
public getOIDByAlgorithm(algorithm: Object): string source
import {getOIDByAlgorithm} from 'pkijs/src/common.js'Get OID for each specific algorithm
Params:
| Name | Type | Attribute | Description |
| algorithm | Object |
public getRandomValues(view: Uint8Array): * source
import {getRandomValues} from 'pkijs/src/common.js'Initialize input Uint8Array by random values (with help from current "crypto engine")
Params:
| Name | Type | Attribute | Description |
| view | Uint8Array |
|
Return:
| * |
public kdf(hashFunction: string, Zbuffer: ArrayBuffer, keydatalen: number, SharedInfo: ArrayBuffer): * source
import {kdf} from 'pkijs/src/common.js'ANS X9.63 Key Derivation Function
Params:
| Name | Type | Attribute | Description |
| hashFunction | string | Used hash function |
|
| Zbuffer | ArrayBuffer | ArrayBuffer containing ECDH shared secret to derive from |
|
| keydatalen | number | Length (!!! in BITS !!!) of used kew derivation function |
|
| SharedInfo | ArrayBuffer | Usually DER encoded "ECC_CMS_SharedInfo" structure |
Return:
| * |
public kdfWithCounter(hashFunction: string, Zbuffer: ArrayBuffer, Counter: number, SharedInfo: ArrayBuffer): * source
import {kdfWithCounter} from 'pkijs/src/common.js'ANS X9.63 Key Derivation Function having a "Counter" as a parameter
Params:
| Name | Type | Attribute | Description |
| hashFunction | string | Used hash function |
|
| Zbuffer | ArrayBuffer | ArrayBuffer containing ECDH shared secret to derive from |
|
| Counter | number | ||
| SharedInfo | ArrayBuffer | Usually DER encoded "ECC_CMS_SharedInfo" structure |
Return:
| * |
public setEngine(name: *, crypto: *, subtle: *) source
import {setEngine} from 'pkijs/src/common.js'Params:
| Name | Type | Attribute | Description |
| name | * | ||
| crypto | * | ||
| subtle | * |
public stringPrep(inputString: string): string source
import {stringPrep} from 'pkijs/src/common.js'String preparation function. In a future here will be realization of algorithm from RFC4518
Params:
| Name | Type | Attribute | Description |
| inputString | string | JavaScript string. As soon as for each ASN.1 string type we have a specific transformation function here we will work with pure JavaScript string |
public async verifySCTsForCertificate(certificate: Certificate, issuerCertificate: Certificate, logs: Object[], index: Number): Array source
import {verifySCTsForCertificate} from 'pkijs/src/SignedCertificateTimestampList.js'Verify SignedCertificateTimestamp for specific certificate content
Params:
| Name | Type | Attribute | Description |
| certificate | Certificate | Certificate for which verification would be performed |
|
| issuerCertificate | Certificate | Certificate of the issuer of target certificate |
|
| logs | Object[] | Array of objects with information about each CT Log (like here: https://ct.grahamedgecombe.com/logs.json) |
|
| logs.log_id | String | Identifier of the CT Log encoded in BASE-64 format |
|
| logs.key | String | Public key of the CT Log encoded in BASE-64 format |
|
| index | Number |
|
Index of SignedCertificateTimestamp inside SignedCertificateTimestampList (for -1 would verify all) |