Instance Methodswift-crypto 3.8.0Crypto
open(_:)
Decrypts a message, if the ciphertext is valid.
HPKE.swift:314mutating func open<C>(_ ciphertext: C) throws -> Data where C : DataProtocol
Parameters
- ciphertext
The ciphertext message to decrypt.
Returns
The resulting cleartext message if the message is authentic.
You can call this method multiple times to decrypt a series of messages. When using this method, the recipient of the ciphertext messages needs to decrypt them in the same order that the sender encrypts them.
Other members in extension
Type members
init<SK>(privateKey: SK, ciphersuite: Ciphersuite, info: Data, encapsulatedKey: Data
) throws Creates a recipient in base mode.
init<SK>(privateKey: SK, ciphersuite: Ciphersuite, info: Data, encapsulatedKey: Data, authenticatedBy: SK.PublicKey
) throws Creates a recipient in authentication mode.
Instance members
func exportSecret<Context>(context: Context, outputByteCount: Int
) throws -> SymmetricKey Exports a secret given domain-separation context and the desired output length.
func open<C, AD>(C, authenticating: AD
) throws -> Data Decrypts a message, if the ciphertext is valid, verifying the integrity of additional authentication data.