Credential

public class Credential

Class to manage a user’s credential.

  • The default registered credential for the current user.

    Declaration

    Swift

    public static let Default = Credential()
  • Declaration

    Swift

    public func getPublicKeyString() -> String

    Return Value

    The hex-encoded public key.

  • Declaration

    Swift

    public func getAddressString() -> String

    Return Value

    The hex-encoded blockchain address for this credential.

  • Declaration

    Swift

    public func getPublicJWK() -> [String:Any]

    Return Value

    The JWK-encoded public key for this credential.

  • Declaration

    Swift

    public func getJwkThumbprint() -> String

    Return Value

    The Base64-URL encoded key JWK thumbprint for this credential.

  • Verify a signature.

    Declaration

    Swift

    public func verifySignature(data: Data, signature: Data) -> Bool

    Return Value

    Boolean true if and only if the signature is valid for this credential.

  • Initialize the credential with a new key pair. This will not overwrite the existing key pair, if one exists.

    Declaration

    Swift

    func initialize() -> Bool

    Return Value

    true if the key pair has been successfully generated.

  • Delete the key pair for this credential. Warning: this will delete both the public and private keys for this credential and cannot be undone.

    Declaration

    Swift

    func delete()
  • Check whether the credential has a valid key pair.

    Declaration

    Swift

    func isValid() -> Bool

    Return Value

    true or false, signifying whether the credential is valid.

  • Declaration

    Swift

    func getRootAddressString() -> String

    Return Value

    The hex-encoded blockchain address for the root of the credential.

  • Undocumented

    Declaration

    Swift

    func updateRootAddressString(root: String)