This repository has been archived on 2023-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
webcrypto/packages/core/src/schema/asn1/one_asymmetric_key.ts

26 lines
659 B
TypeScript

import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { PrivateKeyInfo } from "./private_key_info";
/**
* ```asn
* OneAsymmetricKey ::= SEQUENCE {
* version Version,
* privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
* privateKey PrivateKey,
* attributes [0] IMPLICIT Attributes OPTIONAL,
* ...,
* [[2: publicKey [1] IMPLICIT PublicKey OPTIONAL ]],
* ...
* }
*
* PrivateKey ::= OCTET STRING
*
* PublicKey ::= BIT STRING
* ```
*/
export class OneAsymmetricKey extends PrivateKeyInfo {
@AsnProp({ context: 1, implicit: true, type: AsnPropTypes.BitString, optional: true })
public publicKey?: ArrayBuffer;
}