How to use the pkijs.OCSPRequest function in pkijs

To help you get started, we’ve selected a few pkijs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PeculiarVentures / CAdES.js / examples / CAdESComplexExample / es6.js View on Github external
let userPublicKey;
	let userPrivateKey;
	
	const dataBuffer = new ArrayBuffer(6);
	const dataView = new Uint8Array(dataBuffer);
	dataView[0] = 0x00;
	dataView[1] = 0x01;
	dataView[2] = 0x02;
	dataView[3] = 0x03;
	dataView[4] = 0x04;
	dataView[5] = 0x05;
	
	let cmsSignedSimpl;
	
	const ocspRequest = new OCSPRequest();
	
	const aTSHashIndex = new ATSHashIndex();
	
	let asn1 = asn1js.fromBER(stringToArrayBuffer(atob(User10cert)));
	const certSimpl = new Certificate({ schema: asn1.result });
	
	asn1 = asn1js.fromBER(stringToArrayBuffer(atob(CAcert)));
	const caCertSimpl = new Certificate({ schema: asn1.result });
	//endregion
	
	//region Get a "crypto" extension
	const crypto = getCrypto();
	if(typeof crypto === "undefined")
		return Promise.reject("No WebCrypto extension found");
	//endregion
github PeculiarVentures / CAdES.js / examples / CAdESComplexExample / es6.js View on Github external
dataView[0] = 0x00;
	dataView[1] = 0x01;
	dataView[2] = 0x02;
	dataView[3] = 0x03;
	dataView[4] = 0x04;
	dataView[5] = 0x05;
	
	let cmsSignedSimpl;

	const signatureTimeStamp = new SignatureTimeStamp();
	const cadesCTimeStamp = new CAdESCTimestamp();
	
	const completeCertificateReferences = new CompleteCertificateReferences();
	const completeRevocationReferences = new CompleteRevocationReferences();
	
	const ocspRequest = new OCSPRequest();
	
	let ocspResponse;
	
	let asn1 = asn1js.fromBER(stringToArrayBuffer(atob(User10cert)));
	const certSimpl = new Certificate({ schema: asn1.result });
	
	asn1 = asn1js.fromBER(stringToArrayBuffer(atob(CAcert)));
	const caCertSimpl = new Certificate({ schema: asn1.result });
	//endregion
	
	//region Get a "crypto" extension
	const crypto = getCrypto();
	if(typeof crypto === "undefined")
		return Promise.reject("No WebCrypto extension found");
	//endregion

pkijs

Public Key Infrastructure (PKI) is the basis of how identity and key management is performed on the web today. PKIjs is a pure JavaScript library implementing the formats that are used in PKI applications. It is built on WebCrypto and aspires to make it p

BSD-3-Clause
Latest version published 5 days ago

Package Health Score

81 / 100
Full package analysis