Structure
Insecure.RSA.PrivateKey
A structure representing a private RSA key.
struct PrivateKey
Overview
In JWT, RSA private keys are used to sign JWTs. They consist of a modulus, an exponent, and a private exponent.
Topics
Operators
static func == (Insecure.RSA.PrivateKey, Insecure.RSA.PrivateKey) -> BoolReturns a Boolean value indicating whether two values are equal.
Initializers
init(backing: _RSA.Signing.PrivateKey) throwsCreates anRSA.PrivateKeyfrom a SwiftCrypto private key.init(modulus: String, exponent: String, privateExponent: String) throwsInitializes a newRSA.PrivateKeyinstance with modulus, exponent, and private exponent.init(modulus: String, exponent: String, privateExponent: String, prime1: String, prime2: String) throwsinit(pem:)Creates anRSA.PrivateKeyfrom private key PEM file in Data format.
Instance Properties
var derRepresentation: DataExports the current private key as a DER encoded data.var pemRepresentation: StringExports the current private key as a PEM encoded string.var publicKey: Insecure.RSA.PublicKey
Relationships
Conforms To
RSAKeySwift.EquatableSwift.SendableSwift.SendableMetatype