Class VerifySignatureResult
Object
VerifySignatureResult
VerifySignatureResult
Immutable value object returned by
. It conveys the outcome of a
detached-signature verification together with exhaustive metadata emitted by
the Anka Secure platform.
invalid reference
AnkaSecureSdk#verifySignature
Detached Compact JWS Structure
The service returns a Compact JWS in detached form: three Base64URL-encoded segments separated by dots, where the payload segment is empty:
BASE64URL(Header) .. BASE64URL(Signature)
- Header: JSON object containing signature metadata such
as
alg
(e.g.Falcon-512
or hybridRSA-3072+SHA256
) andkid
(key identifier). - Payload: omitted here (detached); the original file data is supplied separately and verified against the signature.
- Signature: computed over the header and external payload using the negotiated PQC, classical or hybrid algorithm.
Usage example
Path payload = Path.of("data/report.pdf");
Path signature = Path.of("data/report.pdf.sig");
VerifySignatureResult result = sdk.verifySignature(payload, signature);
if (!result.isValid()) {
// Block the workflow or log warning
}
result.getWarnings().forEach(log::warn);
Outcome and Metadata
- Validity flag –
isValid()
reports whether the detached signature matches the supplied payload and the key’s current status permits verification (revocation, expiry, usage caps). - Key metadata – the key initially requested by the caller and the key effectively used after server-side rotation or succession logic.
- Algorithm negotiated – post-quantum, classical or hybrid
algorithm chosen by the crypto-engine (e.g.
Falcon-512
,RSA-3072+SHA256
). - Warnings – non-fatal advisories such as usage caps,
nearing expiry or algorithm deprecation notices. May be
null
or empty if none.
Thread-safety
Instances are effectively immutable once created by the SDK. They may be shared across threads safely provided no setter is invoked.
All getters return non-null
values except
getWarnings(), which may be null
or
empty.
- Since:
- 1.0.0
- Author:
- Anka Technologies SDK Team
-
Constructor Details
-
VerifySignatureResult
public VerifySignatureResult()
-
-
Method Details
-
isValid
public boolean isValid()Indicates whether verification succeeded both cryptographically and against server-side policy checks.- Returns:
true
if valid;false
otherwise
-
getKeyRequested
- Returns:
- key identifier originally requested by the caller
-
getActualKeyUsed
- Returns:
- key identifier effectively used by the server, or
null
if same askeyRequested
-
getAlgorithmUsed
- Returns:
- algorithm negotiated by the crypto-engine
-
getWarnings
-
toString
-
equals
-
hashCode
-