react / wstein / node_modules / browserify / node_modules / crypto-browserify / node_modules / public-encrypt / node_modules / parse-asn1 / node_modules / asn1.js / rfc / 2560 / index.js
80622 viewstry {1var asn1 = require('asn1.js');2var rfc3280 = require('asn1.js-rfc3280');3} catch (e) {4var asn1 = require('../' + '..');5var rfc3280 = require('../' + '3280');6}78var OCSPRequest = asn1.define('OCSPRequest', function() {9this.seq().obj(10this.key('tbsRequest').use(TBSRequest),11this.key('optionalSignature').optional().explicit(0).use(Signature)12);13});14exports.OCSPRequest = OCSPRequest;1516var TBSRequest = asn1.define('TBSRequest', function() {17this.seq().obj(18this.key('version').def('v1').explicit(0).use(rfc3280.Version),19this.key('requestorName').optional().explicit(1).use(rfc3280.GeneralName),20this.key('requestList').seqof(Request),21this.key('requestExtensions').optional().explicit(2).use(rfc3280.Extensions)22);23});24exports.TBSRequest = TBSRequest;2526var Signature = asn1.define('Signature', function() {27this.seq().obj(28this.key('signatureAlgorithm').use(rfc3280.AlgorithmIdentifier),29this.key('signature').bitstr(),30this.key('certs').optional().explicit(0).seqof(rfc3280.Certificate)31);32});33exports.Signature = Signature;3435var Request = asn1.define('Request', function() {36this.seq().obj(37this.key('reqCert').use(CertID),38this.key('singleRequestExtensions').optional().explicit(0).use(39rfc3280.Extensions)40);41});42exports.Request = Request;4344var OCSPResponse = asn1.define('OCSPResponse', function() {45this.seq().obj(46this.key('responseStatus').use(ResponseStatus),47this.key('responseBytes').optional().explicit(0).seq().obj(48this.key('responseType').objid({49'1 3 6 1 5 5 7 48 1 1': 'id-pkix-ocsp-basic'50}),51this.key('response').octstr()52)53);54});55exports.OCSPResponse = OCSPResponse;5657var ResponseStatus = asn1.define('ResponseStatus', function() {58this.enum({590: 'successful',601: 'malformed_request',612: 'internal_error',623: 'try_later',635: 'sig_required',646: 'unauthorized'65});66});67exports.ResponseStatus = ResponseStatus;6869var BasicOCSPResponse = asn1.define('BasicOCSPResponse', function() {70this.seq().obj(71this.key('tbsResponseData').use(ResponseData),72this.key('signatureAlgorithm').use(rfc3280.AlgorithmIdentifier),73this.key('signature').bitstr(),74this.key('certs').optional().explicit(0).seqof(rfc3280.Certificate)75);76});77exports.BasicOCSPResponse = BasicOCSPResponse;7879var ResponseData = asn1.define('ResponseData', function() {80this.seq().obj(81this.key('version').def('v1').explicit(0).use(rfc3280.Version),82this.key('responderID').use(ResponderID),83this.key('producedAt').gentime(),84this.key('responses').seqof(SingleResponse),85this.key('responseExtensions').optional().explicit(0)86.use(rfc3280.Extensions)87);88});89exports.ResponseData = ResponseData;9091var ResponderID = asn1.define('ResponderId', function() {92this.choice({93byName: this.explicit(1).use(rfc3280.Name),94byKey: this.explicit(2).use(KeyHash)95});96});97exports.ResponderID = ResponderID;9899var KeyHash = asn1.define('KeyHash', function() {100this.octstr();101});102exports.KeyHash = KeyHash;103104var SingleResponse = asn1.define('SingleResponse', function() {105this.seq().obj(106this.key('certId').use(CertID),107this.key('certStatus').use(CertStatus),108this.key('thisUpdate').gentime(),109this.key('nextUpdate').optional().explicit(0).gentime(),110this.key('singleExtensions').optional().explicit(1).use(rfc3280.Extensions)111);112});113exports.SingleResponse = SingleResponse;114115var CertStatus = asn1.define('CertStatus', function() {116this.choice({117good: this.implicit(0).null_(),118revoked: this.implicit(1).use(RevokedInfo),119unknown: this.implicit(2).null_()120});121});122exports.CertStatus = CertStatus;123124var RevokedInfo = asn1.define('RevokedInfo', function() {125this.seq().obj(126this.key('revocationTime').gentime(),127this.key('revocationReason').optional().explicit(0).use(rfc3280.CRLReason)128);129});130exports.RevokedInfo = RevokedInfo;131132var CertID = asn1.define('CertID', function() {133this.seq().obj(134this.key('hashAlgorithm').use(rfc3280.AlgorithmIdentifier),135this.key('issuerNameHash').octstr(),136this.key('issuerKeyHash').octstr(),137this.key('serialNumber').use(rfc3280.CertificateSerialNumber)138);139});140exports.CertID = CertID;141142var Nonce = asn1.define('Nonce', function() {143this.octstr();144});145exports.Nonce = Nonce;146147exports['id-pkix-ocsp'] = [ 1, 3, 6, 1, 5, 5, 7, 48, 1 ];148exports['id-pkix-ocsp-nonce'] = [ 1, 3, 6, 1, 5, 5, 7, 48, 1, 2 ];149150151