Interface SignatureService
- All Known Implementing Classes:
SignatureServiceImpl
public interface SignatureService
Pure signature-layer abstraction (no encryption tasks).
Implementations are stateless.
-
Method Summary
Modifier and TypeMethodDescriptionresignBytes
(String newKid, String oldJws) Generates a fresh Compact JWS for the payload embedded inoldJws
.resignFile
(String newKid, Path oldJwsFile, Path newJwsFile) resignFileStream
(Path oldJwsHeader, String newKid, Path input, Path newSignature) Re-sign a detached-payload JWS in streaming mode.
The existing *General-JSON* header (containing the oldkid
) is supplied inoldJwsHeader
.Signs an in-memory payload with the private keykid
.signFileStream
(String kid, Path input, Path signature) verifySignature
(Path compactJwsFile) Verifies a textual Compact JWS that is already in memory.
-
Method Details
-
signFile
- Throws:
AnkaSecureSdkException
-
verifySignature
- Throws:
AnkaSecureSdkException
-
resignFile
ResignFileResult resignFile(String newKid, Path oldJwsFile, Path newJwsFile) throws AnkaSecureSdkException - Throws:
AnkaSecureSdkException
-
signFileStream
- Throws:
AnkaSecureSdkException
-
resignFileStream
ResignFileResult resignFileStream(Path oldJwsHeader, String newKid, Path input, Path newSignature) throws AnkaSecureSdkException 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
.- Parameters:
oldJwsHeader
- 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 replacednewSignature
- destination file that will receive the new signature- Throws:
AnkaSecureSdkException
-
signBytes
Signs an in-memory payload with the private keykid
.- 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- Throws:
AnkaSecureSdkException
- on validation or remote failure
-
verifySignatureBytes
Verifies a textual Compact JWS that is already in memory.- Parameters:
jws
- textual Compact JWS (UTF-8)- Returns:
- outcome, metadata, and Base64 payload
- Throws:
AnkaSecureSdkException
- on validation or remote failure
-
resignBytes
Generates a fresh Compact JWS for the payload embedded inoldJws
. The platform first verifiesoldJws
, then re-signs the payload withnewKid
.- Parameters:
newKid
- private-key ID that must generate the new signatureoldJws
- existing Compact JWS (UTF-8)- Returns:
- dual-key metadata plus the new token
- Throws:
AnkaSecureSdkException
- on validation or remote failure
-