class CoreApi extends AnyRef
A version of the API that does not have scala specific features in it.
- Alphabetic
- By Inheritance
- CoreApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new CoreApi(randomByteVector: IO[ByteVector], sha256Impl: (ByteVector) => ByteVector, signing: Ed25519Signing)
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 augmentPrivateKey(p1: PrivateKey, p2: PrivateKey): PrivateKey
Augment the private key with another.
Augment the private key with another. This does addition in Fr instead of Fp so it matches up the cycle of the curve.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def computePublicKey(privateKey: PrivateKey): IO[PublicKey]
Compute the public key for the private key, if the privateKey represents an invalid value, raise an error in the IO.
- def decrypt(encryptedValue: EncryptedValue, privateKey: PrivateKey): Either[String, Plaintext]
Decrypt the value using privateKey.
Decrypt the value using privateKey.
- encryptedValue
- value we want to decrypt.
- privateKey
- PrivateKey which we want to use to decrypt the EncryptedValue.
- returns
An error if the key didn't match or something was corrupted in the EncryptedValue, otherwise the recovered plaintext.
- def derivePrivateKey(p: Plaintext): PrivateKey
Derive a private key (which can be used for encrypt) from a plaintext.
Derive a private key (which can be used for encrypt) from a plaintext. This is the simplest way to get a private key.
- def deriveSymmetricKey(p: Plaintext): DecryptedSymmetricKey
- def encrypt(plaintext: Plaintext, toPublicKey: PublicKey, publicSigningKey: PublicSigningKey, privateSigningKey: PrivateSigningKey): IO[EncryptedValue]
Encrypt the plaintext to the toPublicKey.
Encrypt the plaintext to the toPublicKey.
- plaintext
- Value to encrypt.
- toPublicKey
- Person to encrypt to.
- publicSigningKey
- The public signing key of the person (or device) who is encrypting this value
- privateSigningKey
- The private signing key of the person (or device) who is encrypting this value
- returns
EncryptedValue which can be decrypted by the matching private key of toPublicKey
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def generateKeyPair: IO[(PrivateKey, PublicKey)]
Generate a key pair using the randomByteVector to create private keys.
- def generatePlaintext: IO[Plaintext]
A plaintext is just an element of G_T, converted to a byte vector.
- def generateTransformKey(fromPrivateKey: PrivateKey, toPublicKey: PublicKey, fromPublicSigningKey: PublicSigningKey, fromPrivateSigningKey: PrivateSigningKey): IO[TransformKey]
Generate a transform key which is used to delegate to the
toPublicKey
from thefromPrivateKey
.Generate a transform key which is used to delegate to the
toPublicKey
from thefromPrivateKey
.- fromPrivateKey
- The person who can currently decrypt the value. (delegator)
- toPublicKey
- The person we want to let decrypt the value. This should be the master Public Key if it's going to a person, or a device key if it's going to a person's device.(delegatee)
- fromPublicSigningKey
- The public signing key of the person (or device) who is generating this transform key
- fromPrivateSigningKey
- The private signing key of the person (or device) who is generating this transform key
- returns
The key which will allow the above transformation to take place
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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()
- def randomPrivateKey: IO[PrivateKey]
Get a new PrivateKey, which is guaranteed to be valid.
- def schnorrSign[A](privateKey: PrivateKey, publicKey: PublicKey, message: A)(implicit arg0: Hashable[A]): IO[SchnorrSignature]
Sign message using privateKey.
Sign message using privateKey. Also requires the public key, which is included in the hash in order to prevent forgery attacks.
- privateKey
- private part of user's master key pair, used to sign message
- publicKey
- corresponding (augmented) public key from user's master key pair
- message
- actual message to sign
- returns
The signature of the message as a pair of byte vectors r and s, wrapped in an IO. Each part is 32 bytes long.
- def schnorrVerify[A](publicKey: PublicKey, augmentingPrivateKey: PrivateKey, message: A, signature: SchnorrSignature)(implicit arg0: Hashable[A]): Boolean
Verify that the signature of a message is valid, given the public key that corresponds to the private key that signed it.
Verify that the signature of a message is valid, given the public key that corresponds to the private key that signed it. This is complicated by the fact that the public key that was supplied to the sign method was an augmented key, and to validate the signature, we need the pre-augmentation public key that actually matches the private key. But we also need the augmented public key, because we included it in the hash that we used for the signature.
- publicKey
- augmented public portion of user's master key pair
- augmentingPrivateKey
- server's key that was used to augment user's original master public key
- message
- message for which to verify the signature
- signature
- signature that was generated for the message using user's master private key
- returns
Boolean - true if signature is valid for the message, given the supplied keys. False otherwise
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transform(encryptedValue: EncryptedValue, transformKey: TransformKey, publicSigningKey: PublicSigningKey, privateSigningKey: PrivateSigningKey): IO[EncryptedValue]
Transform the value
encryptedValue
using the transformKey.Transform the value
encryptedValue
using the transformKey. The returned value can be decrypted by the private key associated to thetoPublicKey
in the transformKey.The transformed value will be signed using the privateSigningKey and will embed the publicSigningKey into the returned value.
- 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])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated