Crescendo SDK
Loading...
Searching...
No Matches

The SDKCore class contains all fundamental methods that can be used by the user to communicate with the SmartCard. More...

Inheritance diagram for CrescendoDLL.SDKCore:

Classes

class   Result
  Represents the outcome of an operation, which can either be successful or a failure. More...
 

Public Types

enum   SecretType { PIN , XAUTH }
  Representing types of secrets that can be used or authentication. More...
 

Public Member Functions

Result  AuthenticateWithXAUTH (string? xauthKey, string? challenge=default!, XAUTHKeyType? xauthKeyType=null)
  Authenticates on the ACA applet using an XAUTH key.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.ClientPINResponse AuthenticatorClientPIN (CrescendoDLL.PCSC.FIDODataStructures.ClientPINRequest request)
  Sends a FIDO CTAP2 authenticatorClientPIN command to manage PIN operations on the authenticator.
 
Result  AuthenticatorConfig (CrescendoDLL.PCSC.FIDODataStructures.ConfigRequest request)
  Sends a FIDO CTAP2 authenticatorConfig command to set certain token properties.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.CredentialManagementResponse AuthenticatorCredentialManagement (CrescendoDLL.PCSC.FIDODataStructures.CredentialManagementRequest credentialManagementRequest)
  Sends a FIDO CTAP2 authenticatorCredentialManagement command to manage discoverable credentials on the authenticator.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.GetAssertionResponse AuthenticatorGetAssertion (CrescendoDLL.PCSC.FIDODataStructures.GetAssertionRequest getAssertionRequest)
  Sends a FIDO CTAP2 authenticatorGetAssertion command to retrieve an assertion from the authenticator.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.AuthenticatorInfo AuthenticatorGetInfo ()
  Sends a FIDO CTAP2 authenticatorGetInfo command to retrieve information about the FIDO Authenticator's capabilities. Elevated privileges are required on Windows.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.GetAssertionResponse AuthenticatorGetNextAssertion ()
  Sends a FIDO CTAP2 authenticatorGetNextAssertion command to retrieve the next assertion from the authenticator.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.LargeBlobsResponse AuthenticatorLargeBlobs (CrescendoDLL.PCSC.FIDODataStructures.LargeBlobsRequest request)
  Sends a FIDO CTAP2 authenticatorLargeBlobs command to read or write large blob data on the authenticator.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.MakeCredentialResponse AuthenticatorMakeCredential (CrescendoDLL.PCSC.FIDODataStructures.MakeCredentialRequest makeCredentialRequest)
  Sends a FIDO CTAP2 authenticatorMakeCredential command to create a new public key credential on the authenticator.
 
Result  AuthenticatorReset ()
  Sends a FIDO CTAP2 authenticatorReset command to reset the authenticator to its default state.
 
Result< string >  ChangePIN (string? newPin)
  This function changes the PIN based on the provided parameters.
 
Result  ChangeXAUTHMode (XAUTHChallengeType xauthMode)
  This function changes the XAUTH mode based on the provided parameter.
 
Result< string >  ConfigureOATHSlot (string? oathSlot, int buttonPress, string? oathKey, string? jsonInputPath, int timeStep, OATHModeName oathMode, string oathCounter, HashAlgoValues oathHash, int codeDigits, string friendlyName, int truncationOffset, string transportKey, string? pskcString, bool requireTouch=false)
  This function configures the OATH slot based on the provided parameters.
 
Result< string >  ConfigureOCRASlot (string? oathSlot, int buttonPress, string ocraSuite, string? oathKey, string? jsonInputPath, string? friendlyName, string transportKey, string? pskcString, bool requireTouch=false)
  This function configures the OCRA OATH slot based on the provided parameters.
 
Result  ConfigureStaticPassword (string? password, string? jsonInputPath, KeyboardEncodings encoding, string? oathSlot, int buttonPress, string friendlyName, bool requireTouch=false)
  This function configures the Static Password on specified OATH slot based on the provided parameters. Only works with Applet version V4.
 
Result< string >  DeleteOATHSlot (string? oathSlot, int buttonPress, string? pskcString)
  This function deletes the oathSlot configuration and key based on the provided parameters.
 
Result  DeleteXAUTHKey (XAUTHKeyType xauthKeyType)
  This function deletes a Symmetric XAUTH key of a specified type from the token.
 
void  Dispose ()
  Releases all resources used by the CrescendoDLL.SDKCore instance.
 
Result< string >  EncryptKEKAndDataWithKEK (AsymmetricKeyParameter publicKey, object inputData, KeyTypeToBeTransferredWithSKI dataType, KeyboardEncodings encoding=KeyboardEncodings.US)
  Encrypts the Key Encryption Key (KEK) and another secret input data with the KEK.
 
record  Error (string Code, string Message)
  Represents an error with a code and a message.
 
Result< string >  FIDOChangePIN (string? newPin)
  Performs a PIN-authenticated FIDO2 CTAP ChangePIN operation with full authentication flow. Elevated privileges are required on Windows.
 
Result  FIDOConfig (CrescendoDLL.PCSC.FIDODataStructures.ConfigRequest configRequest)
  Performs a PIN-authenticated FIDO2 CTAP Authenticator Configuration operation with full authentication flow. Elevated privileges are required on Windows.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.CredentialManagementResponse FIDOCredentialManagement (CrescendoDLL.PCSC.FIDODataStructures.CredentialManagementRequest credentialManagementRequest)
  Performs a PIN-authenticated FIDO2 CTAP CredentialManagement operation with full authentication flow. Elevated privileges are required on Windows.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.GetAssertionResponse FIDOGetAssertion (CrescendoDLL.PCSC.FIDODataStructures.GetAssertionRequest getAssertionRequest)
  Performs a PIN-authenticated FIDO2 CTAP GetAssertion operation with full authentication flow. Elevated privileges are required on Windows.
 
Result< string >  FIDOGetChallenge ()
  This function retrieves a challenge from the FIDO Attestation Applet, that can later be used for PIN unblocking.
 
Result< byte[]>  FIDOLargeBlobRead ()
  Reads the complete serialized large-blob array from the authenticator with automatic fragmentation. Elevated privileges are required on Windows.
 
Result  FIDOLargeBlobWrite (byte[] data, uint maxFragmentLength=0)
  Writes a complete serialized large-blob array to the authenticator with automatic fragmentation and PIN authentication. Elevated privileges are required on Windows.
 
Result< List< KeyValuePair< CrescendoDLL.PCSC.FIDODataStructures.PublicKeyCredentialRpEntity, List< CrescendoDLL.PCSC.FIDODataStructures.CredentialManagementResponse > > > >  FIDOListCredentials ()
  Performs a PIN-authenticated FIDO2 CTAP CredentialManagement operation several times with full authentication flow. Elevated privileges are required on Windows.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.MakeCredentialResponse FIDOMakeCredential (CrescendoDLL.PCSC.FIDODataStructures.MakeCredentialRequest makeCredentialRequest)
  Performs a PIN-authenticated FIDO2 CTAP MakeCredential operation with full authentication flow. Elevated privileges are required on Windows.
 
Result< string >  FIDOSetPIN (string? newPin)
  Performs initial FIDO2 CTAP PIN setup operation with full authentication flow. Elevated privileges are required on Windows.
 
Result  FIDOUnblockPIN (string cryptogram, string? newPin)
  This function unblocks the FIDO PIN using the provided cryptogram and new PIN.
 
Result< string >  GenerateOTP (string? oathSlot, int buttonPress)
  This function generates an OTP (One-Time Password) based on the provided parameters.
 
Result< string >  GetChallenge ()
  Retrieves a XAUTH challenge.
 
Result< string >  GetSKITransportKey ()
  This function retrieves the Secure Key Injection (SKI) RSA3072 transport key.
 
Result< string >  GetTokenCUID ()
  This function retrieves the CUID of the token.
 
Result< string >  ListACAProperties ()
  This function lists the properties of the ACA applet.
 
Result< string >  ListFIDOProperties ()
  Lists the FIDO authenticator properties available for the current session. For Crescendo tokens this includes the FIDO Attestation Applet properties and the attestation certificate (the latter requires elevated privileges on Windows). For generic FIDO authenticators only the standard authenticatorGetInfo block is available — the Crescendo-specific Attestation Applet sections are omitted.
 
Result< string >  ListOATHProperties ()
  Lists the OATH properties of the OATH applet.
 
Result< string >  ListPIVProperties ()
  Prints the properties of the PIV applet.
 
Result  Logout ()
  Logs out of the ACA applet and clears the cache.
 
Result< string >  NewToken (string? newPin)
  Personalizes a new token with newPin (if provided), generates and returns a new PUK and personalizes the PIV Personal info (CHUID).
 
Result< string >  OCRAAuthenticate (string? oathSlot, int buttonPress, string challenge, string? secret, string? session)
  This function performs an OCRA Challenge Response or Digital Signature operation with previously configured OCRA slot.
 
Result  PIVAddDataToDataObject (string berTLVTag, List<(string tag, byte[] data)> tagsData)
  This function adds one or multiple data items to a PIV data object on a token.
 
Result  PIVChangeDataObjectACR (string berTLVTag, ACRCoding personalizationACR, ACRCoding contactUsageACR, ACRCoding contactlessUsageACR)
  This function changes the Access Control Rules (ACR) of a given PIV data object on a token.
 
Result  PIVChangePKISlotACR (string keyReference, ACRCoding personalizationACR, ACRCoding contactUsageACR, ACRCoding contactlessUsageACR)
  This function changes the Access Control Rules (ACR) of a given PIV Key Reference on a token.
 
Result  PIVDeleteCertificate (string berTLVTag)
  This function deletes a certificate identified by the berTLVTag from a token.
 
Result  PIVDeleteDataFromDataObject (string berTLVTag, string tag)
  This function deletes data identified by a tag from a PIV data object on a token.
 
Result  PIVDeleteKey (string keyReference)
  This function deletes a PIV key from the provided key reference, as well as any relevant data from corresponding data object.
 
Result< string >  PIVGenerateKeyPair (PIVCryptographicMechanismIdentifier cryptoMechanism, string keyReference, string? keyName, bool getExistingPublicKey=false)
  Generates an asymmetric key pair on the ACA applet or retrieves the public key and the public exponent of a previously generated key pair, if possible.
 
Result< X509Certificate2 PIVGetCertificate (string berTLVTag)
  This function retrieves a certificate defined by the berTLVTag from a token.
 
Result< string >  PIVGetDataObjectContent (string berTLVTag)
  This function retrieves a PIV data object from a token and returns its content as a JSON string.
 
Result< string >  PIVGetPersonalInfo ()
  Retrieves personal information from a PIV (Personal Identity Verification) card.
 
Result  PIVPutPKIData (string inputFilePath, string? password, PIVObjectType pkiObjectType, string? keyReference, string? berTLVTag, string? keyName, bool importCACerts=true)
  This function puts the PKI (Public Key Infrastructure) data to the token based on the provided parameters.
 
Result< string >  PIVRawCryptoOperation (string keyReference, DataType inputType, string? inputString, string? inputFilePath, DataType outputType)
  This function performs a raw cryptographic operation using a private key stored on the token. This is primarily meant for RSA keys, though it is possible to use ECC key as well.
 
Result< string >  PIVSignData (string keyReference, DataType inputType, string? inputString, string? inputFilePath, DataType outputType, HashAlgoValues hashAlgo, DataType hashType=DataType.BASE64)
  This function signs data using a defined PIV key.
 
Result< string >  PUKPut (string? puk, bool storePukToPIVDataObjects=true)
  Puts a PUK on the token. If no PUK is provided, a random 8 byte PUK is generated.
 
Result  PutXAUTHKey (string? xauthKey, XAUTHKeyType? xauthKeyType, string? jsonInputPath)
  This function puts a Symmetric XAUTH key of a specified type onto the token.
 
Result< string >  ReadCacheFreshness ()
  Reads the cache freshness.
 
Result  ResetPINTries (string newPin, string puk)
  This function resets the PIN tries based on the provided parameters.
 
Result  ResetToken ()
  Resets the token to its default state.
 
  SDKCore (string token)
  Deprecated. Use CrescendoDLL.SDKCore.SDKCore(CrescendoDLL.Token) with a token obtained from CrescendoDLL.TokenDiscovery.ListAll instead. Initializes a new instance of the CrescendoDLL.SDKCore class.
 
  SDKCore (Token token)
  Initializes a new instance of the CrescendoDLL.SDKCore class for a token returned by CrescendoDLL.TokenDiscovery.ListAll.
 
void  SetPINDialog (Func< SecretType, string > userDialog)
  Sets the method to gather the PIN from the user.
 
void  SetPINForPythonWrapper (string pin)
  Sets the PIN for the Python wrapper.
 
void  SetXAUTHDialog (Func< SecretType, string > userDialog)
  Sets the method to gather the XAUTH from the user.
 
void  SetXAUTHForPythonWrapper (string xauth)
  Sets the XAUTH for the Python wrapper.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.U2FAuthenticationResponse U2FAuthentication (CrescendoDLL.PCSC.FIDODataStructures.U2FAuthenticationRequest authenticationRequest)
  Performs a FIDO U2F (CTAP 1) authentication operation to verify a credential. Elevated privileges are required on Windows.
 
Result< string >  U2FGetVersion ()
  Retrieves the supported U2F protocol version from the authenticator. Elevated privileges are required on Windows.
 
Result< CrescendoDLL.PCSC.FIDODataStructures.U2FRegistrationResponse U2FRegistration (CrescendoDLL.PCSC.FIDODataStructures.U2FRegistrationRequest registrationRequest)
  Performs a FIDO U2F (CTAP 1) registration operation to create a new credential. Elevated privileges are required on Windows.
 
Result  UpdatePINProperties (int? maxPinTryCounter, int? maxPinUnlockCounter, int? maxContactlessPinCounter, int? minPinLength, int? maxPinLength, int weakPinControl, int changePinAfterFirstUse, int pinNumericOnly)
  Updates the PIN properties on the ACA applet.
 
Result  VerifyPin ()
  Authenticates on the ACA using PIN, or verifies the authentication status in no PIN is provided.
 

Static Public Member Functions

static void  EndMonitoring ()
  Deprecated. Use CrescendoDLL.TokenManager.StopMonitoring instead. Stops all smart card reader and token monitoring operations and releases associated resources.
 
static List< string >  GetAllAvailableReaders ()
  Retrieves all available smart card readers. Does not communicate with tokens, and therefore should be faster than CrescendoDLL.SDKCore.GetAllAvailableTokens and CrescendoDLL.SDKCore.GetAllReaderInfo.
 
static List<(string ReaderName, byte[] TokenATR, string TokenName, int TokenIndex, string FIDOMDSMetadata)>  GetAllAvailableTokens ()
  Deprecated. Use CrescendoDLL.TokenDiscovery.ListAll and filter by CrescendoDLL.Token.IsCrescendo instead. Retrieves all available smart card tokens with their corresponding reader information and attributes.
 
static List< ReaderInfo GetAllReaderInfo ()
  Deprecated. Use CrescendoDLL.TokenDiscovery.ListAll instead. Retrieves comprehensive information about all smart card readers in the system, including their current state and token details.
 
static void  SetLogAction (CrescendoDLL.Logger.LogActionDelegate logAction)
  Sets the action to be performed when a log message is generated.
 
static void  SetLogLevel (LogLevel severity)
  Sets the severity level for logging.
 
static void  SetLogSensitiveData (bool enable)
  Enables or disables the redaction of sensitive data in logs.
 
static void  StartMonitoring ()
  Deprecated. Use CrescendoDLL.TokenManager.StartMonitoring instead. Starts comprehensive monitoring of smart card readers and tokens for real-time change detection.
 

Public Attributes

APDUEngine  Engine
  The Engine object contains references to applet objects, their current properties and all the necessary internal methods to allow PCSC communication with the SmartCard.
 

Events

static Action< List< ReaderInfo >, List< ReaderChangeInfo > >  OnReadersChanged = default!
  Deprecated. Use CrescendoDLL.TokenManager.OnTokensChanged instead. Event that is triggered whenever changes are detected in the smart card reader or token state during monitoring.
 

Detailed Description

The SDKCore class contains all fundamental methods that can be used by the user to communicate with the SmartCard.

Member Enumeration Documentation

◆ SecretType

Constructor & Destructor Documentation

◆ SDKCore() [1/2]

◆ SDKCore() [2/2]

Member Function Documentation

◆ AuthenticateWithXAUTH()

◆ AuthenticatorClientPIN()

◆ AuthenticatorConfig()

◆ AuthenticatorCredentialManagement()

◆ AuthenticatorGetAssertion()

◆ AuthenticatorGetInfo()

◆ AuthenticatorGetNextAssertion()

◆ AuthenticatorLargeBlobs()

◆ AuthenticatorMakeCredential()

◆ AuthenticatorReset()

◆ ChangePIN()

◆ ChangeXAUTHMode()

◆ ConfigureOATHSlot()

◆ ConfigureOCRASlot()

◆ ConfigureStaticPassword()

◆ DeleteOATHSlot()

◆ DeleteXAUTHKey()

◆ Dispose()

◆ EncryptKEKAndDataWithKEK()

◆ EndMonitoring()

◆ Error()

◆ FIDOChangePIN()

◆ FIDOConfig()

◆ FIDOCredentialManagement()

◆ FIDOGetAssertion()

◆ FIDOGetChallenge()

◆ FIDOLargeBlobRead()

◆ FIDOLargeBlobWrite()

◆ FIDOListCredentials()

◆ FIDOMakeCredential()

◆ FIDOSetPIN()

◆ FIDOUnblockPIN()

◆ GenerateOTP()

◆ GetAllAvailableReaders()

◆ GetAllAvailableTokens()

◆ GetAllReaderInfo()

◆ GetChallenge()

◆ GetSKITransportKey()

◆ GetTokenCUID()

◆ ListACAProperties()

◆ ListFIDOProperties()

◆ ListOATHProperties()

◆ ListPIVProperties()

◆ Logout()

◆ NewToken()

◆ OCRAAuthenticate()

◆ PIVAddDataToDataObject()

◆ PIVChangeDataObjectACR()

◆ PIVChangePKISlotACR()

◆ PIVDeleteCertificate()

◆ PIVDeleteDataFromDataObject()

◆ PIVDeleteKey()

◆ PIVGenerateKeyPair()

◆ PIVGetCertificate()

◆ PIVGetDataObjectContent()

◆ PIVGetPersonalInfo()

◆ PIVPutPKIData()

◆ PIVRawCryptoOperation()

◆ PIVSignData()

◆ PUKPut()

◆ PutXAUTHKey()

◆ ReadCacheFreshness()

◆ ResetPINTries()

◆ ResetToken()

◆ SetLogAction()

◆ SetLogLevel()

◆ SetLogSensitiveData()

◆ SetPINDialog()

◆ SetPINForPythonWrapper()

◆ SetXAUTHDialog()

◆ SetXAUTHForPythonWrapper()

◆ StartMonitoring()

◆ U2FAuthentication()

◆ U2FGetVersion()

◆ U2FRegistration()

◆ UpdatePINProperties()

◆ VerifyPin()

Member Data Documentation

◆ Engine

Event Documentation

◆ OnReadersChanged