Package sonia.scm.security
Interface PublicKey
public interface PublicKey
The public key can be used to verify signatures.
- Since:
- 2.4.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the contacts of the publickey.getId()
Returns id of the public key.getOwner()
Returns the username of the owner or an empty optional.getRaw()
Returns raw of the public key.Returns ids from gpg sub keys.default boolean
verify
(byte[] data, byte[] signature) Verifies that the signature is valid for the given data.boolean
verify
(InputStream stream, byte[] signature) Verifies that the signature is valid for the given data.
-
Method Details
-
getId
String getId()Returns id of the public key. -
getSubkeys
Returns ids from gpg sub keys.- Since:
- 2.19.0
-
getOwner
Returns the username of the owner or an empty optional. -
getRaw
String getRaw()Returns raw of the public key. -
getContacts
Returns the contacts of the publickey.- Returns:
- owner or empty optional
-
verify
Verifies that the signature is valid for the given data.- Parameters:
stream
- stream of data to verifysignature
- signature- Returns:
true
if the signature is valid for the given data
-
verify
default boolean verify(byte[] data, byte[] signature) Verifies that the signature is valid for the given data.- Parameters:
data
- data to verifysignature
- signature- Returns:
true
if the signature is valid for the given data
-