@peculiar/asn1-rsa
Version:
ASN.1 schema for RSA keys and algorithms defined in RFC 8017.
46 lines (45 loc) • 1.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RSASSA_PSS = exports.RsaSaPssParams = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
const object_identifiers_1 = require("../object_identifiers");
const algorithms_1 = require("../algorithms");
class RsaSaPssParams {
hashAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.sha1);
maskGenAlgorithm = new asn1_x509_1.AlgorithmIdentifier({
algorithm: object_identifiers_1.id_mgf1,
parameters: asn1_schema_1.AsnConvert.serialize(algorithms_1.sha1),
});
saltLength = 20;
trailerField = 1;
constructor(params = {}) {
Object.assign(this, params);
}
}
exports.RsaSaPssParams = RsaSaPssParams;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_x509_1.AlgorithmIdentifier, context: 0, defaultValue: algorithms_1.sha1,
})
], RsaSaPssParams.prototype, "hashAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_x509_1.AlgorithmIdentifier, context: 1, defaultValue: algorithms_1.mgf1SHA1,
})
], RsaSaPssParams.prototype, "maskGenAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_schema_1.AsnPropTypes.Integer, context: 2, defaultValue: 20,
})
], RsaSaPssParams.prototype, "saltLength", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_schema_1.AsnPropTypes.Integer, context: 3, defaultValue: 1,
})
], RsaSaPssParams.prototype, "trailerField", void 0);
exports.RSASSA_PSS = new asn1_x509_1.AlgorithmIdentifier({
algorithm: object_identifiers_1.id_RSASSA_PSS,
parameters: asn1_schema_1.AsnConvert.serialize(new RsaSaPssParams()),
});