pkcs8PEMRepresentation
RSA.swift:643- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
var pkcs8PEMRepresentation: String { get }
var pkcs8PEMRepresentation: String { get }
s13_CryptoExtras4_RSAO10EncryptionO10PrivateKeyV22pkcs8PEMRepresentationSSvp
What are these?OF4Z
import _CryptoExtras
Provides additional cryptographic APIs that are not available in CryptoKit (and therefore the core Crypto library).
struct PrivateKey
Identical to PrivateKey
.
enum _RSA
Types associated with the RSA algorithm
enum Encryption
@frozen struct String
A Unicode string value that is a collection of characters.
init<Bytes>(derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA private key from a DER representation.
init(keySize: _RSA.Signing.KeySize) throws
Randomly generate a new RSA private key of a given size.
init(n: some ContiguousBytes, e: some ContiguousBytes, d: some ContiguousBytes, p: some ContiguousBytes, q: some ContiguousBytes) throws
Construct an RSA private key with the specified parameters.
init(pemRepresentation: String) throws
Construct an RSA private key from a PEM representation.
init<Bytes>(unsafeDERRepresentation derRepresentation: Bytes) throws where Bytes : DataProtocol
Construct an RSA public key from a DER representation.
init(unsafeKeySize keySize: _RSA.Signing.KeySize) throws
Randomly generate a new RSA private key of a given size.
init(unsafePEMRepresentation pemRepresentation: String) throws
Construct an RSA public key from a PEM representation.
static func _createFromNumbers(n: some ContiguousBytes, e: some ContiguousBytes, d: some ContiguousBytes) throws -> _RSA.Encryption.PrivateKey
Construct a private key with the specified parameters.
var derRepresentation: Data { get }
var keySizeInBits: Int { get }
var pemRepresentation: String { get }
var publicKey: _RSA.Encryption.PublicKey { get }
func decrypt<D>(_ data: D, padding: _RSA.Encryption.Padding) throws -> Data where D : DataProtocol
Decrypt a message encrypted with this key’s public key and using the specified padding mode.