debugDescription
KeyUsage.swift:319var debugDescription: String { get }
var debugDescription: String { get }
import X509
A library for working with X.509 certificates.
struct KeyUsage
Defines the purpose of the key contained in the certificate.
@frozen struct String
A Unicode string value that is a collection of characters.
init()
Construct a KeyUsage
extension with no usages set.
init(_ ext: Certificate.Extension) throws
Create a new KeyUsage
object by unwrapping a Extension
.
init(digitalSignature: Bool = false, nonRepudiation: Bool = false, keyEncipherment: Bool = false, dataEncipherment: Bool = false, keyAgreement: Bool = false, keyCertSign: Bool = false, cRLSign: Bool = false, encipherOnly: Bool = false, decipherOnly: Bool = false)
Construct a KeyUsage
extension with some usages set.
var cRLSign: Bool { get set }
This is true when the subject public key is used for verifying signatures on certificate revocation lists.
var dataEncipherment: Bool { get set }
This is true when the subject public key is used to encrypt raw data directly, without the use of an intervening symmetric cipher.
var decipherOnly: Bool { get set }
This only has meaning when the keyAgreement
field is also true
. When true
in that case, the subject public key may only be used for decrypting data while performing key agreement.
var description: String { get }
var digitalSignature: Bool { get set }
This is true when the subject public key is used for verifying digital signatures, other than signatures used in certificates (covered by keyCertSign
) or in CRLs (covered by cRLSign
).
var encipherOnly: Bool { get set }
This only has meaning when the keyAgreement
field is also true
. When true
in that case, the subject public key may only be used for encrypting data while performing key agreement.
var keyAgreement: Bool { get set }
This is true when the subject public key is used for key agreement.
var keyCertSign: Bool { get set }
This is true when the subject public key is used for verifying signatures on certificates.
var keyEncipherment: Bool { get set }
This is true when the subject public key is used to encrypt private or secret keys, e.g. for key transport.
var nonRepudiation: Bool { get set }
This is true when the subject public key is used to verify digital signatures used to provide a non-repudiation service that protects against the signing entity denying some action. This does not cover signatures used in certificates (covered by keyCertSign
) or in CRLs (cRLSign
).
func makeCertificateExtension() throws -> Certificate.Extension