public static class DigitalSignature.WithKey extends DigitalSignature
A digital signature that identifies who the public key is owned by.
public WithKey(@NotNull java.security.PublicKey by, @NotNull kotlin.Array[] bytes)
A digital signature that identifies who the public key is owned by.
public boolean verify(@NotNull kotlin.Array[] content)
Utility to simplify the act of verifying a signature.
InvalidKeyException
- if the key to verify the signature with is not valid (i.e. wrong key type for the
signature).SignatureException
- if the signature is invalid (i.e. damaged), or does not match the key (incorrect).public boolean verify(@NotNull OpaqueBytes content)
Utility to simplify the act of verifying a signature.
InvalidKeyException
- if the key to verify the signature with is not valid (i.e. wrong key type for the
signature).SignatureException
- if the signature is invalid (i.e. damaged), or does not match the key (incorrect).public boolean isValid(@NotNull kotlin.Array[] content)
Utility to simplify the act of verifying a signature. In comparison to verify
doesn't throw an
exception, making it more suitable where a boolean is required, but normally you should use the function
which throws, as it avoids the risk of failing to test the result.
InvalidKeyException
- if the key to verify the signature with is not valid (i.e. wrong key type for the
signature).SignatureException
- if the signature is invalid (i.e. damaged).verify
@NotNull public DigitalSignature withoutKey()
@NotNull public java.security.PublicKey getBy()