Package dev.sigstore
Class KeylessSigner
java.lang.Object
dev.sigstore.KeylessSigner
- All Implemented Interfaces:
AutoCloseable
A full sigstore keyless signing flow.
Note: the implementation is thread-safe assuming the clients (Fulcio, OIDC, Rekor) are thread-safe
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final DurationThe instance of theKeylessSignerwill try to reuse a previously acquired certificate if the expiration time on the certificate is more thanminSigningCertificateLifetimetime away. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeylessSigner.Builderbuilder()voidclose()sign(byte[] artifactDigest) Convenience wrapper aroundsign(List)to sign a single digestSign one or more artifact digests using the keyless signing workflow.Convenience wrapper aroundsign(List)to accept a single fileConvenience wrapper aroundsign(List)to accept files instead of digests
-
Field Details
-
DEFAULT_MIN_SIGNING_CERTIFICATE_LIFETIME
The instance of theKeylessSignerwill try to reuse a previously acquired certificate if the expiration time on the certificate is more thanminSigningCertificateLifetimetime away. Otherwise, it will make a new request (OIDC, Fulcio) to obtain a new updated certificate to use for signing. This is a default value for the remaining lifetime of the signing certificate that is considered good enough. -
DEFAULT_INTOTO_PAYLOAD_TYPE
- See Also:
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
builder
-
sign
@CheckReturnValue public List<Bundle> sign(List<byte[]> artifactDigests) throws KeylessSignerException Sign one or more artifact digests using the keyless signing workflow. The oidc/fulcio dance to obtain a signing certificate will only occur once. The same ephemeral private key will be used to sign all artifacts. This method will renew certificates as they expire.- Parameters:
artifactDigests- sha256 digests of the artifacts to sign.- Returns:
- a list of keyless singing results.
- Throws:
KeylessSignerException
-
sign
Convenience wrapper aroundsign(List)to sign a single digest- Parameters:
artifactDigest- sha256 digest of the artifacts to sign.- Returns:
- a keyless singing results.
- Throws:
KeylessSignerException
-
signFiles
@CheckReturnValue public Map<Path,Bundle> signFiles(List<Path> artifacts) throws KeylessSignerException Convenience wrapper aroundsign(List)to accept files instead of digests- Parameters:
artifacts- list of the artifacts to sign.- Returns:
- a map of artifacts and their keyless singing results.
- Throws:
KeylessSignerException
-
signFile
Convenience wrapper aroundsign(List)to accept a single file- Parameters:
artifact- the artifacts to sign- Returns:
- a sigstore bundle
- Throws:
KeylessSignerException
-
attest
- Throws:
KeylessSignerException
-