Packages

class CoreApi extends AnyRef

A version of the API that does not have scala specific features in it.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CoreApi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new CoreApi(randomByteVector: IO[ByteVector], sha256Impl: (ByteVector) => ByteVector, signing: Ed25519Signing)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. 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.

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. 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.

  8. 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.

  9. 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.

  10. def deriveSymmetricKey(p: Plaintext): DecryptedSymmetricKey
  11. 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

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def generateKeyPair: IO[(PrivateKey, PublicKey)]

    Generate a key pair using the randomByteVector to create private keys.

  15. def generatePlaintext: IO[Plaintext]

    A plaintext is just an element of G_T, converted to a byte vector.

  16. 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 the fromPrivateKey.

    Generate a transform key which is used to delegate to the toPublicKey from the fromPrivateKey.

    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

  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. def randomPrivateKey: IO[PrivateKey]

    Get a new PrivateKey, which is guaranteed to be valid.

  24. 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.

  25. 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

  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. 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 the toPublicKey in the transformKey.

    The transformed value will be signed using the privateSigningKey and will embed the publicSigningKey into the returned value.

  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped