SecureCommunicationsVapor Documentation Beta

Structure Key​Store

public struct KeyStore

Tools to create Crypto keys

Methods

private​Key(x963Representation:​)

public static func privateKey(x963Representation: Data) throws -> P256.KeyAgreement.PrivateKey

Returns a P256.KeyAgreement.PrivateKey instance of an ANSI x9.63 representation of the private key.

Parameters

x963Representation Data

ANSI x9.63 representation of the private key.

Throws

An error during the private key process

Returns

P256.KeyAgreement.PrivateKey instance of the private key.

private​Key(raw​Representation:​)

public static func privateKey(rawRepresentation: Data) throws -> P256.KeyAgreement.PrivateKey

Returns a P256.KeyAgreement.PrivateKey instance of raw representation of the private key.

Parameters

raw​Representation Data

raw representation of the private key.

Throws

An error during the private key process

Returns

P256.KeyAgreement.PrivateKey instance of the private key.

private​Key(pem​Representation:​)

public static func privateKey(pemRepresentation: String) throws -> P256.KeyAgreement.PrivateKey

Returns a P256.KeyAgreement.PrivateKey instance of pem representation of the private key.

Parameters

pem​Representation String

pem representation of the private key.

Throws

An error during the private key process

Returns

P256.KeyAgreement.PrivateKey instance of the private key.

private​Key(der​Representation:​)

public static func privateKey(derRepresentation: Data) throws -> P256.KeyAgreement.PrivateKey

Returns a P256.KeyAgreement.PrivateKey instance of der representation of the private key.

Parameters

der​Representation Data

der representation of the private key.

Throws

An error during the private key process

Returns

P256.KeyAgreement.PrivateKey instance of the private key.

public​Key(x963Representation:​)

public static func publicKey(x963Representation: Data) throws -> P256.KeyAgreement.PublicKey

Returns a P256.KeyAgreement.PublicKey instance of an ANSI x9.63 representation of the public key.

Parameters

x963Representation Data

ANSI x9.63 representation of the public key.

Throws

An error during the public key process

Returns

P256.KeyAgreement.PublicKey instance of the public key.

public​Key(raw​Representation:​)

public static func publicKey(rawRepresentation: Data) throws -> P256.KeyAgreement.PublicKey

Returns a P256.KeyAgreement.PublicKey instance of raw representation of the public key.

Parameters

raw​Representation Data

raw representation of the public key.

Throws

An error during the public key process

Returns

P256.KeyAgreement.PublicKey instance of the public key.

public​Key(pem​Representation:​)

public static func publicKey(pemRepresentation: String) throws -> P256.KeyAgreement.PublicKey

Returns a P256.KeyAgreement.PublicKey instance of the public key of a pem representation

Parameters

pem​Representation String

pem representation of the public key.

Throws

An error during the public key process

Returns

P256.KeyAgreement.PublicKey instance of the public key.

public​Key(der​Representation:​)

public static func publicKey(derRepresentation: Data) throws -> P256.KeyAgreement.PublicKey

Returns a P256.KeyAgreement.PublicKey instance of der representation of the public key.

Parameters

der​Representation Data

der representation of the public key.

Throws

An error during the public key process

Returns

P256.KeyAgreement.PublicKey instance of the public key.