object_digest_info.js 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. import { __decorate } from "tslib";
  2. import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
  3. import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
  4. export var DigestedObjectType;
  5. (function (DigestedObjectType) {
  6. DigestedObjectType[DigestedObjectType["publicKey"] = 0] = "publicKey";
  7. DigestedObjectType[DigestedObjectType["publicKeyCert"] = 1] = "publicKeyCert";
  8. DigestedObjectType[DigestedObjectType["otherObjectTypes"] = 2] = "otherObjectTypes";
  9. })(DigestedObjectType || (DigestedObjectType = {}));
  10. export class ObjectDigestInfo {
  11. digestedObjectType = DigestedObjectType.publicKey;
  12. otherObjectTypeID;
  13. digestAlgorithm = new AlgorithmIdentifier();
  14. objectDigest = new ArrayBuffer(0);
  15. constructor(params = {}) {
  16. Object.assign(this, params);
  17. }
  18. }
  19. __decorate([
  20. AsnProp({ type: AsnPropTypes.Enumerated })
  21. ], ObjectDigestInfo.prototype, "digestedObjectType", void 0);
  22. __decorate([
  23. AsnProp({
  24. type: AsnPropTypes.ObjectIdentifier,
  25. optional: true,
  26. })
  27. ], ObjectDigestInfo.prototype, "otherObjectTypeID", void 0);
  28. __decorate([
  29. AsnProp({ type: AlgorithmIdentifier })
  30. ], ObjectDigestInfo.prototype, "digestAlgorithm", void 0);
  31. __decorate([
  32. AsnProp({ type: AsnPropTypes.BitString })
  33. ], ObjectDigestInfo.prototype, "objectDigest", void 0);