class JcePureCrypto extends CryptoPureApi with ShowUtil
- Alphabetic
- By Inheritance
- JcePureCrypto
- ShowUtil
- ShowSyntax
- ToShowOps
- CryptoPureApi
- RandomOps
- HashOps
- HkdfOps
- HmacOps
- SigningOps
- EncryptionOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new JcePureCrypto(javaKeyConverter: JceJavaConverter, defaultSymmetricKeyScheme: SymmetricKeyScheme, defaultHashAlgorithm: HashAlgorithm)
Type Members
- implicit class ShowAnyRefSyntax extends AnyRef
- Definition Classes
- ShowUtil
- implicit class ShowEitherSyntax[L, R] extends AnyRef
Enables the syntax
show"${myEither.showMerged}"
.Enables the syntax
show"${myEither.showMerged}"
.- Definition Classes
- ShowUtil
- implicit class ShowLengthLimitedStringSyntax extends StringOperators
- Definition Classes
- ShowUtil
- implicit class ShowLengthLimitedStringWrapperSyntax extends StringOperators
- Definition Classes
- ShowUtil
- implicit class ShowOptionSyntax[T] extends AnyRef
- Definition Classes
- ShowUtil
- implicit class ShowProductSyntax extends AnyRef
- Definition Classes
- ShowUtil
- Annotations
- @SuppressWarnings()
- implicit class ShowStringSyntax extends StringOperators
- Definition Classes
- ShowUtil
- implicit class ShowTraversableSyntax[T] extends AnyRef
Enables syntax like
show"Found several elements: ${myCollection.mkShow()}"
.Enables syntax like
show"Found several elements: ${myCollection.mkShow()}"
.- Definition Classes
- ShowUtil
- abstract class StringOperators extends AnyRef
Enables syntax like
show"This is a string: ${myString.doubleQuoted}"
andshow"This is a hash: ${myHash.readableHash}"
.Enables syntax like
show"This is a string: ${myString.doubleQuoted}"
andshow"This is a hash: ${myHash.readableHash}"
.- Definition Classes
- ShowUtil
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def build(purpose: HashPurpose, algorithm: HashAlgorithm = defaultHashAlgorithm): HashBuilder
Creates a HashBuilder for computing a hash with the given purpose.
Creates a HashBuilder for computing a hash with the given purpose. For different purposes
purpose1
andpurpose2
, all implementations must ensure that it is computationally infeasible to find a sequencebs
of com.google.protobuf.ByteStrings such thatbs.foldLeft(hashBuilder(purpose1))((b, hb) => hb.add(b)).finish
andbs.foldLeft(hashBuilder(purpose2))((b, hb) => hb.add(b)).finish
yield the same hash.- Definition Classes
- HashOps
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def computeHkdf(keyMaterial: ByteString, outputBytes: Int, info: HkdfInfo, salt: ByteString = ByteString.EMPTY, algorithm: HmacAlgorithm = defaultHmacAlgorithm): Either[HkdfError, SecureRandomness]
Produce a new secret from the given key material using the HKDF from RFC 5869 with both extract and expand phases.
Produce a new secret from the given key material using the HKDF from RFC 5869 with both extract and expand phases.
- keyMaterial
Input key material from which to derive another key.
- outputBytes
The length of the produced secret. May be at most 255 times the size of the output of the selected hashing algorithm. If you need to derive multiple keys, set the
info
parameter to different values, for each key that you need.- info
Specify the purpose of the derived key (optional). Note that you can derive multiple independent keys from the same key material by varying the purpose.
- salt
Optional salt. Should be set if the input key material is not cryptographically secure, uniformly random.
- algorithm
The hash algorithm to be used for the HKDF construction
- Definition Classes
- HkdfOps
- def computeHkdfInternal(keyMaterial: ByteString, outputBytes: Int, info: HkdfInfo, salt: ByteString, algorithm: HmacAlgorithm): Either[HkdfError, SecureRandomness]
- Attributes
- protected
- Definition Classes
- JcePureCrypto → HkdfOps
- def createSymmetricKey(bytes: SecureRandomness, scheme: SymmetricKeyScheme): Either[EncryptionKeyCreationError, SymmetricKey]
Creates a symmetric key with the specified scheme for the given randomness.
Creates a symmetric key with the specified scheme for the given randomness.
- Definition Classes
- JcePureCrypto → EncryptionOps
- def decryptWith[M](encrypted: Encrypted[M], symmetricKey: SymmetricKey)(deserialize: (ByteString) => Either[DeserializationError, M]): Either[DecryptionError, M]
Decrypts a message encrypted using
encryptWith
Decrypts a message encrypted using
encryptWith
- Definition Classes
- JcePureCrypto → EncryptionOps
- def decryptWith[M](encrypted: AsymmetricEncrypted[M], privateKey: EncryptionPrivateKey)(deserialize: (ByteString) => Either[DeserializationError, M]): Either[DecryptionError, M]
Decrypts a message encrypted using
encryptWith
Decrypts a message encrypted using
encryptWith
- Definition Classes
- EncryptionOps
- def decryptWithInternal[M](encrypted: AsymmetricEncrypted[M], privateKey: EncryptionPrivateKey)(deserialize: (ByteString) => Either[DeserializationError, M]): Either[DecryptionError, M]
- Attributes
- protected
- Definition Classes
- JcePureCrypto → EncryptionOps
- val defaultHashAlgorithm: HashAlgorithm
- Definition Classes
- JcePureCrypto → HashOps
- def defaultHmacAlgorithm: HmacAlgorithm
- Definition Classes
- HmacOps
- val defaultSymmetricKeyScheme: SymmetricKeyScheme
- Definition Classes
- JcePureCrypto → EncryptionOps
- def digest(purpose: HashPurpose, bytes: ByteString, algorithm: HashAlgorithm = defaultHashAlgorithm): Hash
Convenience method for
build(purpose).addWithoutLengthPrefix(bytes).finish
Convenience method for
build(purpose).addWithoutLengthPrefix(bytes).finish
- Definition Classes
- HashOps
- def encryptWith[M <: HasVersionedToByteString](message: M, symmetricKey: SymmetricKey, version: ProtocolVersion): Either[EncryptionError, Encrypted[M]]
Encrypts the given message with the given symmetric key
Encrypts the given message with the given symmetric key
- Definition Classes
- JcePureCrypto → EncryptionOps
- def encryptWith[M <: HasVersionedToByteString](message: M, publicKey: EncryptionPublicKey, version: ProtocolVersion): Either[EncryptionError, AsymmetricEncrypted[M]]
Encrypts the given bytes using the given public key
Encrypts the given bytes using the given public key
- Definition Classes
- JcePureCrypto → EncryptionOps
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def generateRandomByteString(length: Int): ByteString
- Definition Classes
- RandomOps
- def generateRandomBytes(length: Int): Array[Byte]
- Attributes
- protected
- Definition Classes
- JcePureCrypto → RandomOps
- def generateSecureRandomness(length: Int): SecureRandomness
- Definition Classes
- RandomOps
- def generateSymmetricKey(scheme: SymmetricKeyScheme): Either[EncryptionKeyGenerationError, SymmetricKey]
Generates and returns a random symmetric key using the specified scheme.
Generates and returns a random symmetric key using the specified scheme.
- Definition Classes
- JcePureCrypto → EncryptionOps
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hkdfExpand(keyMaterial: SecureRandomness, outputBytes: Int, info: HkdfInfo, algorithm: HmacAlgorithm = defaultHmacAlgorithm): Either[HkdfError, SecureRandomness]
Produce a new secret from the given secret and purpose.
Produce a new secret from the given secret and purpose. Only performs the expand step of the HKDF from RFC 5869.
- keyMaterial
Cryptographically secure, uniformly random initial key material. Must be at least as long as the length of the hash function chosen for the HMAC scheme.
- outputBytes
The length of the produced secret. May be at most 255 times the size of the output of the selected hashing algorithm. If you need to derive multiple keys, set the
info
parameter to different values, for each key that you need.- info
Specify the purpose of the derived key (optional). Note that you can derive multiple independent keys from the same key material by varying the purpose.
- algorithm
The hash algorithm to be used for the HKDF construction
- Definition Classes
- HkdfOps
- def hkdfExpandInternal(keyMaterial: SecureRandomness, outputBytes: Int, info: HkdfInfo, algorithm: HmacAlgorithm): Either[HkdfError, SecureRandomness]
- Attributes
- protected
- Definition Classes
- JcePureCrypto → HkdfOps
- def hmacWithSecret(secret: HmacSecret, message: ByteString, algorithm: HmacAlgorithm = defaultHmacAlgorithm): Either[HmacError, Hmac]
- Definition Classes
- HmacOps
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- implicit final def showInterpolator(sc: StringContext): ShowInterpolator
- Definition Classes
- ShowSyntax
- implicit def showPretty[T](implicit arg0: Pretty[T]): Show[T]
Enables the syntax
show"This object is pretty: $myPrettyType"
.Enables the syntax
show"This object is pretty: $myPrettyType"
.- Definition Classes
- ShowUtil
- def sign(bytes: ByteString, signingKey: SigningPrivateKey): Either[SigningError, Signature]
- Attributes
- protected[crypto]
- Definition Classes
- JcePureCrypto → SigningOps
- def sign(hash: Hash, signingKey: SigningPrivateKey): Either[SigningError, Signature]
Signs the given hash using the private signing key.
Signs the given hash using the private signing key.
- Definition Classes
- SigningOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit def toShow[A](target: A)(implicit tc: Show[A]): Ops[A]
- Definition Classes
- ToShowOps
- def toString(): String
- Definition Classes
- AnyRef → Any
- def verifySignature(bytes: ByteString, publicKey: SigningPublicKey, signature: Signature): Either[SignatureCheckError, Unit]
- Attributes
- protected[crypto]
- Definition Classes
- JcePureCrypto → SigningOps
- def verifySignature(hash: Hash, publicKey: SigningPublicKey, signature: Signature): Either[SignatureCheckError, Unit]
Confirms if the provided signature is a valid signature of the payload using the public key
Confirms if the provided signature is a valid signature of the payload using the public key
- Definition Classes
- SigningOps
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])