mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 12:35:07 +08:00
# Conflicts: # jsowell-ui/.env.development # jsowell-ui/.env.staging # jsowell-ui/bin/build-sit.bat # jsowell-ui/bin/build.bat # jsowell-ui/src/api/adapayMember/adapayMember.js # jsowell-ui/src/api/pile/merchant.js # jsowell-ui/src/router/index.js # jsowell-ui/src/views/financial/financeDetail.vue # jsowell-ui/src/views/financial/merchant.vue # jsowell-ui/src/views/homeIndex/homeIndex.vue # jsowell-ui/src/views/login.vue # jsowell-ui/src/views/pile/basic/detail.vue # jsowell-ui/src/views/pile/station/components/SiteInfo.vue # jsowell-ui/src/views/pile/station/detail.vue # jsowell-ui/src/views/pile/station/orderReport.vue
92 lines
2.2 KiB
JavaScript
92 lines
2.2 KiB
JavaScript
/**
|
|
* Copyright (c) 2019 Digital Bazaar, Inc.
|
|
*/
|
|
|
|
var forge = require('./forge');
|
|
require('./asn1');
|
|
var asn1 = forge.asn1;
|
|
|
|
exports.privateKeyValidator = {
|
|
// PrivateKeyInfo
|
|
name: 'PrivateKeyInfo',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.SEQUENCE,
|
|
constructed: true,
|
|
value: [{
|
|
// Version (INTEGER)
|
|
name: 'PrivateKeyInfo.version',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.INTEGER,
|
|
constructed: false,
|
|
capture: 'privateKeyVersion'
|
|
}, {
|
|
// privateKeyAlgorithm
|
|
name: 'PrivateKeyInfo.privateKeyAlgorithm',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.SEQUENCE,
|
|
constructed: true,
|
|
value: [{
|
|
name: 'AlgorithmIdentifier.algorithm',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.OID,
|
|
constructed: false,
|
|
capture: 'privateKeyOid'
|
|
}]
|
|
}, {
|
|
// PrivateKey
|
|
name: 'PrivateKeyInfo',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.OCTETSTRING,
|
|
constructed: false,
|
|
capture: 'privateKey'
|
|
}]
|
|
};
|
|
|
|
exports.publicKeyValidator = {
|
|
name: 'SubjectPublicKeyInfo',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.SEQUENCE,
|
|
constructed: true,
|
|
captureAsn1: 'subjectPublicKeyInfo',
|
|
value: [{
|
|
name: 'SubjectPublicKeyInfo.AlgorithmIdentifier',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.SEQUENCE,
|
|
constructed: true,
|
|
value: [{
|
|
name: 'AlgorithmIdentifier.algorithm',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.OID,
|
|
constructed: false,
|
|
capture: 'publicKeyOid'
|
|
}]
|
|
},
|
|
// capture group for ed25519PublicKey
|
|
{
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.BITSTRING,
|
|
constructed: false,
|
|
composed: true,
|
|
captureBitStringValue: 'ed25519PublicKey'
|
|
}
|
|
// FIXME: this is capture group for rsaPublicKey, use it in this API or
|
|
// discard?
|
|
/* {
|
|
// subjectPublicKey
|
|
name: 'SubjectPublicKeyInfo.subjectPublicKey',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.BITSTRING,
|
|
constructed: false,
|
|
value: [{
|
|
// RSAPublicKey
|
|
name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',
|
|
tagClass: asn1.Class.UNIVERSAL,
|
|
type: asn1.Type.SEQUENCE,
|
|
constructed: true,
|
|
optional: true,
|
|
captureAsn1: 'rsaPublicKey'
|
|
}]
|
|
} */
|
|
]
|
|
};
|