CryptoKey
A cryptographic key (RSA or elliptic-curve).
CryptoKey.swift:20class CryptoKey
The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other Resource
.
They can be used to generate a self-signed X509Certificate
via generateSelfSignedCertificate(key:issuerName:notBefore:notAfter:)
and as private key in acceptStream(_:serverOptions:)
along with the appropriate certificate.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func isPublicOnly(
) -> Bool Returns
true
if this CryptoKey only has the public part, and not the private one.func load(path: String, publicOnly: Bool
) -> GodotError Loads a key from
path
. IfpublicOnly
istrue
, only the public key will be loaded.func loadFromString(stringKey: String, publicOnly: Bool
) -> GodotError Loads a key from the given
stringKey
. IfpublicOnly
istrue
, only the public key will be loaded.func save(path: String, publicOnly: Bool
) -> GodotError Saves a key to the given
path
. IfpublicOnly
istrue
, only the public key will be saved.func saveToString(publicOnly: Bool
) -> String Returns a string containing the key in PEM format. If
publicOnly
istrue
, only the public key will be included.