public enum EasyBox extends Enum<EasyBox>
| Modifier and Type | Class and Description |
|---|---|
static class |
EasyBox.KeyPair
Helper class to handle KeyPair creation Explicitly named static methods are provided to help avoid mistakes from calling the wrong
constructor overload Constructors in turn are made private
|
static class |
EasyBox.Nonce
Helper class to wrap Nonce creation and re-use A nonce should only be used for a single message exchange, then refreshed Refresh
either by calling next() or stir() depending on the use case - next increments the nonce by 1 in a deterministic fashion (eg for
ordered message exchange) - stir fully randomises the nonce again Explicitly named static methods are provided to help avoid mistakes
from calling the wrong constructor overload
|
static class |
EasyBox.PublicKey
Helper class to manage the public part of a KeyPair A PublicKey is created internally as part of a KeyPair, and provides a
strongly-typed wrapper over the underlying BytesStore
|
static class |
EasyBox.SecretKey
Helper class to manage the secret part of a KeyPair A SecretKey is created internally as part of a KeyPair, and provides a
strongly-typed wrapper over the underlying BytesStore
|
static class |
EasyBox.SharedKey
Helper class to handle shared key corresponding to given key pair (or parts of) A shared key can be used when multiple messages are
being exchanged between the same sender/receiver This avoids the same shared key being deduced from the sender/receiver key pair on
every message, resulting in significantly better speeds
|
| Modifier and Type | Method and Description |
|---|---|
static net.openhft.chronicle.bytes.BytesStore |
decrypt(@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore publicKey,
net.openhft.chronicle.bytes.BytesStore secretKey)
Underlying decrypt call taking explicit BytesStores Where possible the strongly-typed versions above should be preferred
|
static net.openhft.chronicle.bytes.BytesStore |
decrypt(@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
As above, but result BytesStore is passed in first arg
|
static @NotNull net.openhft.chronicle.bytes.BytesStore |
decrypt(@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
Decrypt a message given a nonce, sender's public key, and receiver's private key
|
static net.openhft.chronicle.bytes.BytesStore |
decryptShared(@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore sharedKey)
Underlying decryptShared call taking explicit BytesStores Where possible the strongly-typed versions above should be preferred
|
static net.openhft.chronicle.bytes.BytesStore |
decryptShared(@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
As above, but result BytesStore is passed in first arg
|
static net.openhft.chronicle.bytes.BytesStore |
decryptShared(@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
Decrypt a message given a nonce and a *shared* secret key The shared key should be precalculated using KeyPair.precalc Using a shared
key can substantially improve performance when the same sender/receiver exchange many messages
|
static net.openhft.chronicle.bytes.BytesStore |
encrypt(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore publicKey,
net.openhft.chronicle.bytes.BytesStore secretKey)
Underlying encrypt call taking explicit BytesStores Where possible the strongly-typed versions above should be preferred
|
static net.openhft.chronicle.bytes.BytesStore |
encrypt(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
As above, but result BytesStore is passed in first arg
|
static net.openhft.chronicle.bytes.BytesStore |
encrypt(net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
Encrypt a message given a nonce, receivers public key, and own private key
|
static net.openhft.chronicle.bytes.BytesStore |
encryptShared(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore sharedKey)
Underlying encryptShared call taking explicit BytesStores Where possible the strongly-typed versions above should be preferred
|
static net.openhft.chronicle.bytes.BytesStore |
encryptShared(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
As above, but result BytesStore is passed in first arg
|
static net.openhft.chronicle.bytes.BytesStore |
encryptShared(net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
Encrypt a message given a nonce and a *shared* secret key The shared key should be precalculated using KeyPair.precalc Using a shared
key can substantially improve performance when the same sender/receiver exchange many messages
|
static EasyBox |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EasyBox[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static EasyBox[] values()
for (EasyBox c : EasyBox.values()) System.out.println(c);
public static EasyBox valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static net.openhft.chronicle.bytes.BytesStore encrypt(net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
message - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - the recipients public keysecretKey - - the sender's private keypublic static net.openhft.chronicle.bytes.BytesStore encrypt(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
result - - the ByteStore for the ciphertext result remaining params as abovemessage - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - the recipients public keysecretKey - - the sender's private keypublic static net.openhft.chronicle.bytes.BytesStore encrypt(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore publicKey,
net.openhft.chronicle.bytes.BytesStore secretKey)
result - - the ByteStore for the ciphertext result remaining params as abovemessage - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - the recipients public keysecretKey - - the sender's private keypublic static net.openhft.chronicle.bytes.BytesStore encryptShared(net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
message - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from recipient's public and sender's private keypublic static net.openhft.chronicle.bytes.BytesStore encryptShared(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
result - - the BytesStore for the ciphertext result remaining params as abovemessage - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from recipient's public and sender's private keypublic static net.openhft.chronicle.bytes.BytesStore encryptShared(net.openhft.chronicle.bytes.BytesStore result,
net.openhft.chronicle.bytes.BytesStore message,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore sharedKey)
result - - the BytesStore for the ciphertext result remaining params as abovemessage - - the cleartext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from recipient's public and sender's private key@NotNull
public static @NotNull net.openhft.chronicle.bytes.BytesStore decrypt(@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
ciphertext - - the encrypted messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - sender's public keysecretKey - - receiver's private keypublic static net.openhft.chronicle.bytes.BytesStore decrypt(@Nullable
@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.PublicKey publicKey,
EasyBox.SecretKey secretKey)
result - - the BytesStore for the cleartext result remaining params as aboveciphertext - - the encrypted messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - sender's public keysecretKey - - receiver's private keypublic static net.openhft.chronicle.bytes.BytesStore decrypt(@Nullable
@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore publicKey,
net.openhft.chronicle.bytes.BytesStore secretKey)
result - - the BytesStore for the cleartext result remaining params as aboveciphertext - - the encrypted messagenonce - - one-off tag associated with this message exchange. PublicpublicKey - - sender's public keysecretKey - - receiver's private keypublic static net.openhft.chronicle.bytes.BytesStore decryptShared(@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
ciphertext - - the ciphertext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from sender's public and recipient's private keypublic static net.openhft.chronicle.bytes.BytesStore decryptShared(@Nullable
@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
EasyBox.Nonce nonce,
EasyBox.SharedKey sharedKey)
result - - the BytesStore for the cleartext result remaining params as aboveciphertext - - the ciphertext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from sender's public and recipient's private keypublic static net.openhft.chronicle.bytes.BytesStore decryptShared(@Nullable
@Nullable net.openhft.chronicle.bytes.BytesStore result,
@NotNull
@NotNull net.openhft.chronicle.bytes.BytesStore ciphertext,
net.openhft.chronicle.bytes.BytesStore nonce,
net.openhft.chronicle.bytes.BytesStore sharedKey)
result - - the BytesStore for the cleartext result remaining params as aboveciphertext - - the ciphertext messagenonce - - one-off tag associated with this message exchange. PublicsharedKey - - the shared key formed from sender's public and recipient's private keyCopyright © 2023. All rights reserved.