Instance Methodswift-crypto 3.12.2_CryptoExtras
getKeyPrimitives
RSA.swift:561- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func getKeyPrimitives() throws -> Primitives
func getKeyPrimitives() throws -> Primitives
s13_CryptoExtras4_RSAO10EncryptionO9PublicKeyV03getF10PrimitivesAG0H0VyKF
What are these?EF7V
import _CryptoExtras
Provides additional cryptographic APIs that are not available in CryptoKit (and therefore the core Crypto library).
struct PublicKey
Identical to PublicKey
.
enum _RSA
Types associated with the RSA algorithm
enum Encryption
struct Primitives
init<Bytes>(derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA public key from a DER representation.
init(n: some ContiguousBytes, e: some ContiguousBytes) throws
Construct an RSA public key with the specified parameters.
init(pemRepresentation: String) throws
Construct an RSA public key from a PEM representation.
init<Bytes>(unsafeDERRepresentation derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA public key from a DER representation.
init(unsafePEMRepresentation pemRepresentation: String) throws
Construct an RSA public key from a PEM representation.
var derRepresentation: Data { get }
var keySizeInBits: Int { get }
var pemRepresentation: String { get }
var pkcs1DERRepresentation: Data { get }
var pkcs1PEMRepresentation: String { get }
func encrypt<D>(_ data: D, padding: _RSA.Encryption.Padding) throws -> Data where D : DataProtocol
Encrypt a message with this key, using the specified padding mode.
func maximumEncryptSize(with padding: _RSA.Encryption.Padding) -> Int
Return the maximum amount of data in bytes this key can encrypt in a single operation when using the specified padding mode.