Class SignatureServiceImpl
Object
SignatureServiceImpl
- All Implemented Interfaces:
SignatureService
Thread-safe implementation of
SignatureService
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresignBytes
(String newKid, String oldJws) Re-sign a Compact JWS switching tonewKid
.resignFile
(String newKid, Path oldJws, Path newJws) resignFileStream
(Path oldJws, String newKid, Path input, Path newSigOut) Re-sign a detached-payload JWS in streaming mode.
The existing *General-JSON* header (containing the oldkid
) is supplied inoldJwsHeader
.Sign an in-memory payload with a server-side **private** key.signFileStream
(String kid, Path input, Path sigOut) verifySignature
(Path jwsFile) verifySignatureBytes
(String jwsToken) Verify a Compact JWS that is fully in memory.
-
Constructor Details
-
SignatureServiceImpl
public SignatureServiceImpl(AnkaSecureOpenApiClient api)
-
-
Method Details
-
signFile
- Specified by:
signFile
in interfaceSignatureService
-
verifySignature
- Specified by:
verifySignature
in interfaceSignatureService
-
resignFile
- Specified by:
resignFile
in interfaceSignatureService
-
signFileStream
- Specified by:
signFileStream
in interfaceSignatureService
-
resignFileStream
Description copied from interface:SignatureService
Re-sign a detached-payload JWS in streaming mode.
The existing *General-JSON* header (containing the oldkid
) is supplied inoldJwsHeader
. The payload itself is streamed frominput
.- Specified by:
resignFileStream
in interfaceSignatureService
- Parameters:
oldJws
- UTF-8 file that contains the original JWS header (General-JSON, detached payload)newKid
- key identifier that must sign the refreshed JWSinput
- data whose signature is being replacednewSigOut
- destination file that will receive the new signature
-
signBytes
Sign an in-memory payload with a server-side **private** key.- Specified by:
signBytes
in interfaceSignatureService
- Parameters:
kid
- private-key ID in Anka Secure (must not benull
)data
- bytes to be signed (must not benull
)- Returns:
SignFileResult
containing the detached Compact JWS and metadata
-
verifySignatureBytes
Verify a Compact JWS that is fully in memory.- Specified by:
verifySignatureBytes
in interfaceSignatureService
- Parameters:
jwsToken
- textual Compact JWS (UTF-8)- Returns:
- outcome, metadata, and Base64 payload
-
resignBytes
Re-sign a Compact JWS switching tonewKid
.- Specified by:
resignBytes
in interfaceSignatureService
- Parameters:
newKid
- private-key ID that must generate the new signatureoldJws
- existing Compact JWS (UTF-8)- Returns:
- dual-key metadata plus the new token
-