-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add AttestationApplicationId schema
- Loading branch information
1 parent
19f45e8
commit 5145f19
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { AsnProp, AsnPropTypes, OctetString } from "@peculiar/asn1-schema"; | ||
|
||
/** | ||
* Implements ASN.1 structure for attestation package info. | ||
* | ||
* ```asn | ||
* AttestationPackageInfo ::= SEQUENCE { | ||
* package_name OCTET_STRING, | ||
* version INTEGER, | ||
* } | ||
* ``` | ||
*/ | ||
export class AttestationPackageInfo { | ||
@AsnProp({ type: AsnPropTypes.OctetString }) | ||
public packageName!: OctetString; | ||
|
||
@AsnProp({ type: AsnPropTypes.Integer }) | ||
public version!: number; | ||
|
||
constructor(params: Partial<AttestationPackageInfo> = {}) { | ||
Object.assign(this, params); | ||
} | ||
} | ||
|
||
/** | ||
* Implements ASN.1 structure for attestation application id. | ||
* | ||
* ```asn | ||
* AttestationApplicationId ::= SEQUENCE { | ||
* package_infos SET OF AttestationPackageInfo, | ||
* signature_digests SET OF OCTET_STRING, | ||
* } | ||
* ``` | ||
*/ | ||
export class AttestationApplicationId { | ||
@AsnProp({ type: AttestationPackageInfo, repeated: "set" }) | ||
public packageInfos!: AttestationPackageInfo[]; | ||
|
||
@AsnProp({ type: AsnPropTypes.OctetString, repeated: "set" }) | ||
public signatureDigests!: OctetString[]; | ||
|
||
constructor(params: Partial<AttestationApplicationId> = {}) { | ||
Object.assign(this, params); | ||
} | ||
} |