Skip to content

Commit

Permalink
expose signature on SignatureContent (#922)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <bdehamer@github.com>
  • Loading branch information
bdehamer authored Jan 4, 2024
1 parent 9652ed6 commit 45903bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-hotels-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/verify": patch
---

Expose public `signature` property on `SignatureContent` interface
2 changes: 1 addition & 1 deletion packages/verify/src/bundle/dsse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DSSESignatureContent implements SignatureContent {
return crypto.verify(this.preAuthEncoding, key, this.signature);
}

private get signature(): Buffer {
public get signature(): Buffer {
return this.env.signatures.length > 0
? this.env.signatures[0].sig
: Buffer.from('');
Expand Down
2 changes: 1 addition & 1 deletion packages/verify/src/bundle/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { MessageSignature } from '@sigstore/bundle';
import type { SignatureContent } from '../shared.types';

export class MessageSignatureContent implements SignatureContent {
private readonly signature: Buffer;
public readonly signature: Buffer;
private readonly messageDigest: Buffer;
private readonly artifact: Buffer;

Expand Down
1 change: 1 addition & 0 deletions packages/verify/src/shared.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export type VerificationKey =
};

export type SignatureContent = {
signature: Buffer;
compareSignature(signature: Buffer): boolean;
compareDigest(digest: Buffer): boolean;
verifySignature(key: crypto.KeyObject): boolean;
Expand Down

0 comments on commit 45903bc

Please sign in to comment.