ClaimUtils

public class ClaimUtils

Utility methods for retrieving stored claims.

  • Load all claims from the local key chain that match the default registry.

    Declaration

    Swift

    public static func loadKeychainClaims() -> [Claim]

    Return Value

    Array of parsed Claim objects.

  • Parse string LOA to return Float value

    Declaration

    Swift

    public static func parseLOA(loa: String?) -> Float

    Return Value

    Float value of LOA

  • Find best latest issued claim by LOA from array of Claims

    Declaration

    Swift

    public static func findBestClaimByLOA(_ claims: [Claim]) -> Claim?

    Return Value

    Claim with best latest issued claim by LOA

  • Delete all claims from the local key chain.

    Declaration

    Swift

    public static func deleteAllClaims()
  • Retreive a tuple of claims and issuers as Der.

    Declaration

    Swift

    public static func getClaimsDer(claims certificates: [Claim]) -> ([Data], [Data])

    Parameters

    claims

    Which claims to Der

    Return Value

    An tubple of der claims and issuers.

  • List of Der Claims to List of PEMs.

    Declaration

    Swift

    public static func derToPem(_ ders: [Data]) -> [String]

    Parameters

    ders

    List of DERs

    Return Value

    List of PEMS.

  • Der Claim to PEM.

    Declaration

    Swift

    public static func derToPem(_ der: Data) -> String

    Parameters

    der

    Claim der

    Return Value

    List of pems.

  • Base64 encode a list of claim ders.

    Declaration

    Swift

    public static func derToBase64(_ ders: [Data]) -> [String]

    Parameters

    ders

    List of ders

    Return Value

    List of base64 encoded claims.

  • Delete the specified claim from the local key chain.

    Declaration

    Swift

    public static func deleteClaim(_ claim: Claim) -> Bool

    Parameters

    claim

    the Claim to delete from the key chain.

    Return Value

    true iff the claim was successfully deleted.

  • Undocumented

    Declaration

    Swift

    public static func isClaimExistsInKeyChain(_ claim: Claim) -> Bool
  • Match objectIDs in issued claims. This may return multiple certificate for the same OID, from different issuers.

    Declaration

    Swift

    public static func matchClaims(objectIds: [OIDs.Dotted], preferredValue: String?, issuerIDs: [OIDs.Dotted:String]) -> [Claim]

    Parameters

    objectIds

    Dotted object IDs

    preferredValue

    Prefer claims with this value, if found.

    issuerIDs

    Prefer claims from this issuer, if found.

    Return Value

    Matching claims

  • Check a claim is tagged as essential or not

    Declaration

    Swift

    public static func isEssentialClaim (searchClaim: String, claims: NSMutableDictionary?) -> Bool

    Parameters

    searchClaim

    claims

    Return Value

  • Get claim names that are tagged as essential -> true

    Declaration

    Swift

    public static func getEssentialClaimNames(claims: String) -> [String]

    Parameters

    claims

    Return Value

    Array of essential claims

  • SerialNo is unique for a claim. Convert serialNo from byte array to hexastring for each claim and finally concatenate all the claim serialNo string as CSV.

    Declaration

    Swift

    public static func getClaimsUniqueIDString(claims: [Claim]) -> String

    Parameters

    claims

    List of claim objects.

    Return Value

    Claim serial number in hexstring format from the given claim list, concatenated as comma seperated string.

  • Event can have 1 or more Claim information (serialNumbersCSV) and each claim can have 1 or more claim attributes. For each serialNumber, fetch the claim details from wallet certificates.

    Declaration

    Swift

    public static func getClaimDetails (_ serialNumbersCSV: String) -> [Claim]

    Parameters

    serialNumbersCSV

    Claim Id (serialNo) in CSV format

    Return Value

    List of claim objects for the claim serial numbers provided in CSV.

  • Holds all the claim related attributes to show in event details. Display Claims object holds rich information per claim like essential/voluntary claim; claim shared/not shared.

    Declaration

    Swift

    public static func getDisplayClaims(oidList: [OIDs.Dotted]
        , requestedClaims: String
        , claimsSharedCSV: String
        , claimPreferredValue: String
        , exactClaimMatch: Bool = false) -> [DisplayClaim]

    Parameters

    oidList

    Includes scope and requested claims OID

    requestedClaims

    Claims that are requested explicitly -> Claim object in JSON encoded string

    claimsSharedCSV

    Claims that are shared by user -> Claim Id (serialNo) in CSV format

    claimPreferredValue

    be default username will be passed

    Return Value

    List of DisplayClaim objects with rich information (actions performed by user on individual claims).

    • function name: getClaimsForDisplayClaims This function takes displayed claims and return the equivalent issued claim from DocumentManager
    • return: list of claims matching the shared display claims

    Declaration

    Swift

    public static func getClaimsForDisplayClaims(claims: [Claim], displayClaims: [DisplayClaim]) -> [Claim]

    Parameters

    claims

    Array of Claims

    displayClaims

    Array of displayClaims