message-signing/CoseSign1.ts
CoseSign1 overview
COSE_Sign1 structures (RFC 8152).
Added in v2.0.0
Table of contents
Constructors
coseSign1BuilderNew
Create a new COSESign1Builder.
Signature
export declare const coseSign1BuilderNew: (
headers: Headers,
payload: Uint8Array,
isPayloadExternal: boolean
) => COSESign1BuilderAdded in v2.0.0
Conversion
coseSign1FromCBORBytes
Decode COSESign1 from CBOR bytes.
Signature
export declare const coseSign1FromCBORBytes: (bytes: Uint8Array, options?: CBOR.CodecOptions) => COSESign1Added in v2.0.0
coseSign1FromCBORHex
Decode COSESign1 from CBOR hex.
Signature
export declare const coseSign1FromCBORHex: (hex: string, options?: CBOR.CodecOptions) => COSESign1Added in v2.0.0
coseSign1ToCBORBytes
Encode COSESign1 to CBOR bytes.
Signature
export declare const coseSign1ToCBORBytes: (coseSign1: COSESign1, options?: CBOR.CodecOptions) => Uint8ArrayAdded in v2.0.0
coseSign1ToCBORHex
Encode COSESign1 to CBOR hex.
Signature
export declare const coseSign1ToCBORHex: (coseSign1: COSESign1, options?: CBOR.CodecOptions) => stringAdded in v2.0.0
Model
COSESign1 (class)
COSE_Sign1 structure (RFC 8152) - signed message.
Signature
export declare class COSESign1Added in v2.0.0
fromUserFacingEncoding (static method)
Parse from user-facing encoding format (cms_<base64url>).
Signature
static fromUserFacingEncoding(encoded: string): COSESign1Added in v2.0.0
toJSON (method)
Signature
toJSON()toString (method)
Signature
toString(): string[Inspectable.NodeInspectSymbol] (method)
Signature
[Inspectable.NodeInspectSymbol](): unknown[Equal.symbol] (method)
Signature
[Equal.symbol](that: unknown): boolean[Hash.symbol] (method)
Signature
[Hash.symbol](): numbersignedData (method)
Get the signed data (Sig_structure as per RFC 8152).
Signature
signedData(externalAad: Uint8Array = new Uint8Array(), externalPayload?: Uint8Array): Uint8ArrayAdded in v2.0.0
toUserFacingEncoding (method)
Convert to user-facing encoding format (cms_<base64url>).
Includes checksum for data integrity verification.
Signature
toUserFacingEncoding(): stringAdded in v2.0.0
COSESign1Builder (class)
Builder for creating COSE_Sign1 structures.
Signature
export declare class COSESign1BuilderAdded in v2.0.0
toJSON (method)
Signature
toJSON()toString (method)
Signature
toString(): string[Inspectable.NodeInspectSymbol] (method)
Signature
[Inspectable.NodeInspectSymbol](): unknown[Equal.symbol] (method)
Signature
[Equal.symbol](that: unknown): boolean[Hash.symbol] (method)
Signature
[Hash.symbol](): numbersetExternalAad (method)
Set external additional authenticated data.
Signature
setExternalAad(aad: Uint8Array): thisAdded in v2.0.0
hashPayloadWith224 (method)
Hash the payload with blake2b-224 and update headers. Sets the "hashed" header to true in unprotected headers.
Signature
hashPayloadWith224(): thisAdded in v2.0.0
makeDataToSign (method)
Create the data that needs to be signed (Sig_structure).
Signature
makeDataToSign(): Uint8ArrayAdded in v2.0.0
build (method)
Build the final COSESign1 structure with the provided signature.
Signature
build(signature: Ed25519Signature.Ed25519Signature): COSESign1Added in v2.0.0
Schemas
COSESign1FromCBORBytes
CBOR bytes transformation schema for COSESign1.
Signature
export declare const COSESign1FromCBORBytes: (
options?: CBOR.CodecOptions
) => Schema.transformOrFail<
Schema.transformOrFail<
typeof Schema.Uint8ArrayFromSelf,
Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
never
>,
Schema.SchemaClass<COSESign1, COSESign1, never>,
never
>Added in v2.0.0
COSESign1FromCBORHex
CBOR hex transformation schema for COSESign1.
Signature
export declare const COSESign1FromCBORHex: (
options?: CBOR.CodecOptions
) => Schema.transform<
Schema.Schema<Uint8Array, string, never>,
Schema.transformOrFail<
Schema.transformOrFail<
typeof Schema.Uint8ArrayFromSelf,
Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
never
>,
Schema.SchemaClass<COSESign1, COSESign1, never>,
never
>
>Added in v2.0.0