CredentialRef

open class CredentialRef : CredentialRefProtocol, @unchecked Sendable
extension CredentialRef: CustomDebugStringConvertible

A compact reference to a credential that has been persisted in CoreCrypto.

Credentials can be quite large; this type avoids passing them back and forth across the FFI boundary more than strictly required.

Created by calling add_credential on a CoreCryptoContext.

This reference is not a literal in-memory reference. It is instead the key from which a credential can be retrieved, and is stable over time and across the FFI boundary.

  • Get the cipher suite of this credential ref.

    Declaration

    Swift

    open func cipherSuite() -> CipherSuite
  • Get the client id associated with this credential ref.

    Declaration

    Swift

    open func clientId() -> ClientId
  • Get the earliest possible validity of this credential, expressed as seconds after the unix epoch.

    For an X509 credential this is the leaf certificate’s not_before claim. A basic credential has no such claim, and reads as the time it was persisted.

    Declaration

    Swift

    open func earliestValidity() -> UInt64
  • Get the SHA256 hash of the public key associated with this credential ref.

    Declaration

    Swift

    open func publicKeyHash() -> Data
  • Get the signature scheme of this credential ref.

    Declaration

    Swift

    open func signatureScheme() -> SignatureScheme
  • Get the type of this credential ref.

    Declaration

    Swift

    open func type() -> CredentialType
  • Declaration

    Swift

    open var debugDescription: String { get }