trait SyncCryptoApi extends AnyRef
impure part of the crypto api with access to private key store and knowledge about the current entity to key assoc
- Alphabetic
- By Inheritance
- SyncCryptoApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def decrypt[M](encryptedMessage: AsymmetricEncrypted[M])(deserialize: (ByteString) => Either[DeserializationError, M])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncCryptoError, M]
Decrypts a message using the private key of the public key identified by the fingerprint in the AsymmetricEncrypted object.
- abstract def encryptFor[M <: HasToByteString, MemberType <: Member](message: M, members: Seq[MemberType])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, (MemberType, SyncCryptoError), Map[MemberType, AsymmetricEncrypted[M]]]
Encrypts a message for the given members
Encrypts a message for the given members
Utility method to lookup a key on an IPS snapshot and then encrypt the given message with the most suitable key for the respective key owner.
- abstract def ipsSnapshot: TopologySnapshot
- abstract def pureCrypto: CryptoPureApi
- abstract def sign(hash: Hash, usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncCryptoError, Signature]
Signs the given hash using the private signing key.
Signs the given hash using the private signing key. It uses the most recent signing key with the specified usage in the private store. The key usage must intersect with the provided usage, but it does not need to satisfy all the provided usages.
- hash
the hash to sign
- usage
restricts signing to private keys that have at least one matching usage
- abstract def unsafePartialVerifySequencerSignatures(hash: Hash, signatures: NonEmpty[Seq[Signature]], usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SignatureCheckError, Unit]
This verifies that at least one of the signature is a valid sequencer signature.
This verifies that at least one of the signature is a valid sequencer signature. In particular, it does not respect the participant trust threshold. This should be used only in the context of reassignment where the concept of cross-synchronizer proof of sequencing is not fully fleshed out.
TODO(#12410) Remove this method and respect trust threshold
- abstract def verifyMediatorSignatures(hash: Hash, mediatorGroupIndex: MediatorGroupIndex, signatures: NonEmpty[Seq[Signature]], usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SignatureCheckError, Unit]
Verifies a list of
signatures
to be produced by active members of amediatorGroup
, counting each member's signature only once.Verifies a list of
signatures
to be produced by active members of amediatorGroup
, counting each member's signature only once. ReturnsRight
when themediatorGroup
's threshold is met. Can be successful even if some signatures fail the check, logs the errors in that case. When the threshold is not met returnsLeft
with all the signature check errors. - abstract def verifySequencerSignatures(hash: Hash, signatures: NonEmpty[Seq[Signature]], usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SignatureCheckError, Unit]
- abstract def verifySignature(hash: Hash, signer: Member, signature: Signature, usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SignatureCheckError, Unit]
Verify signature of a given owner.
Verify signature of a given owner. Convenience method to lookup a key of a given owner, synchronizer and timestamp and verify the result.
- usage
verifies that the signature was produced with a signing key with at least one matching usage
- abstract def verifySignatures(hash: Hash, signer: Member, signatures: NonEmpty[Seq[Signature]], usage: NonEmpty[Set[SigningKeyUsage]])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SignatureCheckError, Unit]
Concrete 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 clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- 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
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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])