KeyMatcher, net.sergeych.tools.Bindablepublic class PublicKey extends AbstractKey
| Modifier and Type | Field | Description |
|---|---|---|
static net.sergeych.biserializer.BiAdapter |
PUBLIC_KEY_BI_ADAPTER |
FINGERPRINT_SHA256, FINGERPRINT_SHA384, keyInfo, TYPE_PRIVATE, TYPE_PRIVATE_PASSWORD, TYPE_PRIVATE_PASSWORD_V2, TYPE_PUBLIC| Constructor | Description |
|---|---|
PublicKey() |
|
PublicKey(byte[] bytes) |
|
PublicKey(byte[] bytes,
KeyInfo info) |
|
PublicKey(AbstractPublicKey publicKey) |
| Modifier and Type | Method | Description |
|---|---|---|
byte[] |
encrypt(byte[] bytes) |
|
byte[] |
encrypt(java.lang.String plainText) |
|
boolean |
equals(java.lang.Object obj) |
Keys equality check.
|
byte[] |
fingerprint() |
The fingerprint of the key is a uniqie sequence of bytes that matches the key without compromising it.
|
int |
getBitStrength() |
|
long |
getPublicExponent() |
|
int |
hashCode() |
|
boolean |
isPublic() |
|
byte[] |
pack() |
|
Digest |
updateDigestWithKeyComponents(Digest digest) |
Arbitrary fingerprint calculation.
|
boolean |
verify(java.io.InputStream source,
byte[] signature,
HashType hashType) |
address, asKeySource, canSign, createAnonymousId, decrypt, fromBinder, getLongAddress, getPublicKey, getShortAddress, info, isMatchingKey, isMatchingKeyAddress, isPrivate, matchAnonymousId, matchTag, matchType, packedInfo, packToBase64String, setTag, setTag, sign, sign, toBinder, toString, unpack, updateFrom, verify, verifypublic static final net.sergeych.biserializer.BiAdapter PUBLIC_KEY_BI_ADAPTER
public PublicKey(AbstractPublicKey publicKey)
public PublicKey()
public PublicKey(byte[] bytes)
throws EncryptionError
EncryptionErrorpublic PublicKey(byte[] bytes,
KeyInfo info)
throws EncryptionError
EncryptionErrorpublic boolean isPublic()
isPublic in class AbstractKeypublic int getBitStrength()
public byte[] encrypt(byte[] bytes)
throws EncryptionError
encrypt in class AbstractKeyEncryptionErrorpublic byte[] encrypt(java.lang.String plainText)
throws EncryptionError
EncryptionErrorpublic byte[] pack()
pack in class AbstractKeypublic boolean verify(java.io.InputStream source,
byte[] signature,
HashType hashType)
throws java.io.IOException
verify in class AbstractKeyjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - key to compare with. Should be PublicKey instaance.public int hashCode()
hashCode in class java.lang.Objectpublic byte[] fingerprint()
AbstractKey
Therefore, the private key fingerprint is its public key fingerprint. The public key fingerprint is calculated
using some hash over it's parameters, see fingerprint()
fingerprint in class AbstractKeypublic Digest updateDigestWithKeyComponents(Digest digest)
AbstractKeyCreate any digest you need and call this method to update it with a ket data.
This can and should be used to obtain higher-order composite fingerprints for high security setups.
updateDigestWithKeyComponents in class AbstractKeypublic long getPublicExponent()