Skip to content

Commit

Permalink
feat: Add support for timestamp digest algorithm in sign method
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Aug 7, 2024
1 parent dd102ea commit b84db43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ inputs:
description: "The URL of the RFC 3161 time stamp server."
required: false
default: ""
timestamp_digest_algorithm:
description: "Specifies the digest algorithm to use for creating time stamps."
required: false
default: ""
description:
description: "Specifies a description of the signed content."
required: false
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ async function run() {
file,
certificate,
timestampUrl: core.getInput('timestamp_url') || undefined,
timestampRfc3161Url: core.getInput('timestamp_rfc3161_url') || undefined,
timestampDigestAlgorithm: core.getInput('timestamp_digest_algorithm') || undefined,
description: core.getInput('description') || undefined,
descriptionUrl: core.getInput('description_url') || undefined,
additionalCertificates: core.getInput('additional_certificate') || undefined,
Expand Down
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface SignOptions {
certificate: string;
timestampUrl?: string;
timestampRfc3161Url?: string;
timestampDigestAlgorithm?: string;
description?: string;
descriptionUrl?: string;
additionalCertificates?: string;
Expand All @@ -99,6 +100,9 @@ export async function sign(options: SignOptions) {
if (options.timestampRfc3161Url) {
args['tr'] = options.timestampRfc3161Url;
}
if (options.timestampDigestAlgorithm) {
args['td'] = options.timestampDigestAlgorithm;
}
if (options.description) {
args['d'] = options.description;
}
Expand Down

0 comments on commit b84db43

Please sign in to comment.