oprfRepresentation
An RFC 9497 OPRF representation of the public key.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
var oprfRepresentation: Data { get }
An RFC 9497 OPRF representation of the public key.
var oprfRepresentation: Data { get }
s6Crypto4P384O01_A6ExtrasE6_VOPRFO9PublicKeyV18oprfRepresentation20FoundationEssentials4DataVvp
What are these?30XV0
import _CryptoExtras
import Crypto
struct PublicKey
A P-384 public key used to blind inputs and finalize blinded elements.
enum P384
An elliptic curve that enables NIST P-384 signatures and key agreement.
enum _VOPRF
A mechanism to compute the output of a pseudorandom without the client learning the secret or the server learning the input using the P384-SHA384 Verifiable Oblivious Pseudorandom Function (VOPRF).
@frozen struct Data
init<Bytes>(compactRepresentation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-384 public key for VOPRF(P-384, SHA-384) from a compact representation of the key.
init<Bytes>(compressedRepresentation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-384 public key for VOPRF(P-384, SHA-384) from a compressed representation of the key.
init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8
Creates a P-384 public key for VOPRF(P-384, SHA-384) from a Distinguished Encoding Rules (DER) encoded representation.
init(pemRepresentation: String) throws
Creates a P-384 public key for VOPRF(P-384, SHA-384) from a Privacy-Enhanced Mail (PEM) representation.
init<D>(rawRepresentation: D) throws where D : ContiguousBytes
Creates a P-384 public key for VOPRF(P-384, SHA-384) from a collection of bytes.
init<Bytes>(x963Representation: Bytes) throws where Bytes : ContiguousBytes
Creates a P-384 public key for VOPRF(P-384, SHA-384) from an ANSI x9.63 representation.
var compactRepresentation: Data? { get }
A compact representation of the public key.
var compressedRepresentation: Data { get }
A compressed representation of the public key.
var derRepresentation: Data { get }
A Distinguished Encoding Rules (DER) encoded representation of the public key.
var pemRepresentation: String { get }
A Privacy-Enhanced Mail (PEM) representation of the public key.
var rawRepresentation: Data { get }
A full representation of the public key.
var x963Representation: Data { get }
An ANSI x9.63 representation of the public key.
func blind<D>(_ input: D) throws -> P384._VOPRF.BlindedInput where D : DataProtocol
Blind an input to be evaluated by the server using the VOPRF protocol.
func finalize(_ blindedInput: P384._VOPRF.BlindedInput, using blindEvaluation: P384._VOPRF.BlindEvaluation) throws -> Data
Compute the output of the VOPRF by verifying the server proof, and unblinding and hashing the evaluated element.