Skip to content

Commit

Permalink
add EdDSA to JwsHeaderParams['alg'] type (decentralized-identity#194
Browse files Browse the repository at this point in the history
)

* `[crypto/jose]` add `EdDSA` to `JwsHeaderParams['alg']`

---------

Co-authored-by: Frank Hinek <[email protected]>
  • Loading branch information
mistermoe and frankhinek authored Sep 21, 2023
1 parent d56ec18 commit 59a3045
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions packages/crypto/src/jose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,42 @@ export type JwkKeyPair = {
export type JsonWebKey = PrivateKeyJwk | PublicKeyJwk;

export interface JoseHeaderParams {
// Content Type
cty?: string;
// JWK Set URL
jku?: string;
// JSON Web Key
jwk?: PublicKeyJwk;
// Key ID
kid?: string;
// Type
typ?: string;
// X.509 Certificate Chain
x5c?: string[];
// X.509 Certificate SHA-1 Thumbprint
x5t?: string;
// X.509 URL
x5u?: string;
}

export interface JwsHeaderParams extends JoseHeaderParams {
alg:
// HMAC using SHA-256
| 'HS256'
// HMAC using SHA-384
| 'HS384'
// HMAC using SHA-512
| 'HS512'
// Edwards curve digital signature algorithm (e.g., Ed25519)
| 'EdDSA'
// ECDSA using P-256 and SHA-256
| 'ES256'
// ECDSA using secp256k1 curve and SHA-256
| 'ES256K'
// ECDSA using P-384 and SHA-384
| 'ES384'
// ECDSA using P-521 and SHA-512
| 'ES512';
| 'ES512'
// HMAC using SHA-256
| 'HS256'
// HMAC using SHA-384
| 'HS384'
// HMAC using SHA-512
| 'HS512';

// Indicates that extensions to JOSE RFCs are being used
// that MUST be understood and processed.
Expand Down

0 comments on commit 59a3045

Please sign in to comment.