Init the PIN
Namespace:
Cryptware.NCryptokiAssembly: NCryptoki (in NCryptoki.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function InitPIN ( _ pin As Byte() _ ) As Integer |
C# |
---|
public int InitPIN( byte[] pin ) |
Visual C++ |
---|
public: virtual int InitPIN( [InAttribute] array<unsigned char>^ pin ) sealed |
JavaScript |
---|
function initPIN(pin); |
Parameters
- pin
- Type: array<System..::..Byte>[]()[]
PIN
Return Value
0 if no error occurs, PKCS#11 error code otherwiseImplements
ISession..::..InitPIN(array<Byte>[]()[][])
Remarks
InitPIN initializes the normal user’s PIN. hSession is the session’s handle; pin points to the normal user’s PIN;
This PIN can contain any valid UTF8 character, but the token may impose subset restrictions.
InitPIN can only be called in the “R/W SO Functions” state. An attempt to call it from a session in any other state fails with error CKR_USER_NOT_LOGGED_IN. If the token has a “protected authentication path”, as indicated by the CKF_PROTECTED_AUTHENTICATION_PATH flag in its CK_TOKEN_INFO being set, then that means that there is some way for a user to be authenticated to the token without having the application send a PIN through the Cryptoki library. One such possibility is that the user enters a PIN on a PINpad on the token itself, or on the slot device. To initialize the normal user’s PIN on a token with such a protected authentication path, the pin parameter to InitPIN should be null. During the execution of InitPIN, the SO will enter the new PIN through the protected authentication path. If the token has a protected authentication path other than a PINpad, then it is tokendependent whether or not InitPIN can be used to initialize the normal user’s token access.
InitPIN can only be called in the “R/W SO Functions” state. An attempt to call it from a session in any other state fails with error CKR_USER_NOT_LOGGED_IN. If the token has a “protected authentication path”, as indicated by the CKF_PROTECTED_AUTHENTICATION_PATH flag in its CK_TOKEN_INFO being set, then that means that there is some way for a user to be authenticated to the token without having the application send a PIN through the Cryptoki library. One such possibility is that the user enters a PIN on a PINpad on the token itself, or on the slot device. To initialize the normal user’s PIN on a token with such a protected authentication path, the pin parameter to InitPIN should be null. During the execution of InitPIN, the SO will enter the new PIN through the protected authentication path. If the token has a protected authentication path other than a PINpad, then it is tokendependent whether or not InitPIN can be used to initialize the normal user’s token access.