📄 cmtcmn.h
字号:
* FUNCTION: CMT_SetStringAttribute * -------------------------------- * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource on the psm server which the * application wants to set an attribute for. * fieldID * The numerical representation of the attribute the application wants * to set. * value * A pointer to a CMTItem containing the string (binary or ASCII) that * the application wants to set as the attribute value. * * NOTES * This function requests that the psm server set a string attribute for * a resource. The fieldID should be one of the enumerations defined by * then enumeration SSMAttributeID. Each resource has a set of attributes * that can be set on the psm server. Refer to the function where a * resource is created for a list of attributes that a given resource has. * * RETURN * A return value of CMTSuccess indicates the psm server successfully set * requested string attribute for the resource. Any other return value * indicates an error in setting the resource. */CMTStatus CMT_SetStringAttribute(PCMT_CONTROL control, CMUint32 resourceID, CMUint32 fieldID, CMTItem *value);/* * FUNCTION: CMT_SetNumericAttribute * --------------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource on the psm server which the * application wants to set an attribute for. * fieldID * The numerical representation of the attribute the application wants * to set. * value * A pointer to a CMTItem containing the string (binary or ASCII) that * the application wants to set as the attribute value. * * NOTES * This function requests that the psm server set a numeric attribute for * a resource. The fieldID should be one of the enumerations defined by * then enumeration SSMAttributeID. Each resource has a set of attributes * that can be set on the psm server. Refer to the function where a * resource is created for a list of attributes that a given resource has. * * RETURN * A return value of CMTSuccess indicates the psm server successfully set * requested numeric attribute for the resource. Any other return value * indicates an error in setting the resource. */CMTStatus CMT_SetNumericAttribute(PCMT_CONTROL control, CMUint32 resourceID, CMUint32 fieldID, CMInt32 value);/* * FUNCTION: CMT_GetRIDAttribute * ----------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource on the psm server the application * wants to retrieve an attributre from. * fieldID * The numerical representation of the attribute the application wants * to retrieve. * value * A pointer to a pre-allocated CMUint32 where the library can place * a copy of the desired RID attribute value retrieved from the * resource. * * NOTES * This function sends a message to the psm server requesting an attribute * from the resource with ID "resourceID" that in turn is a resource ID. * The parameter fieldID should be one of the values defined by the enumeration * SSMAttributeID. Refer to the function where a resource is created for a * list of attributes that a given resource has. The application should * use this function to retrieve attributes that are resource ID's instead * of CMT_GetNumericAttribute because this funcion will increase the reference * count on the resource corresponding to the retrieved resource ID so that * the resource does not disappear while the application can reference it. * * RETURN * A return value of CMTSuccess indicates the psm server successfully * retrieved the desired attribute and place it's value at *value. Any * other return value indicates an error and the value at *value should * be ignored. */CMTStatus CMT_GetRIDAttribute(PCMT_CONTROL control, CMUint32 resourceID, CMUint32 fieldID, CMUint32 *value);/* * FUNCTION: CMT_DestroyResource * ----------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource on the psm server the application * wants to destroy. * resourceType * The type of resource the application is trying to destroy. This value * should be one defined by the enumeration SSMResourceType. * * NOTES * This function sends a message to the psm server release its reference on * the resource passed in. */CMTStatus CMT_DestroyResource(PCMT_CONTROL control, CMUint32 resourceID, CMUint32 resourceType);/* * FUNCTION: CMT_PickleResource * ---------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource on the psm server the application * wants to destroy. * pickledResource * A pointer to a CMTItem where the library can place * the pickled resource on successful return. * NOTES * This function sends a message to the psm server requesting the resource * passed in be converted to a binary stream that can be re-instantiated * at a later time by a call to CMT_UnpickleResource (during the same * execution of the application). * * RETURN * A return value of CMTSuccess indicates the resource was pickled successfully * and the resulting stream is located at *pickledResource. After the pickled * resource is no longer needed, the application should free the pickled * resource by calling CMT_FreeItem. Any other return value indicates an * error and the value at *pickledResource should be ignored. */CMTStatus CMT_PickleResource(PCMT_CONTROL control, CMUint32 resourceID, CMTItem * pickledResource);/* * FUNCTION: CMT_UnpickleResource * ------------------------------ * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceType * A value defined by the enumeration SSMResourceType which is the * type of the resource to unpickle. * pickledResource * The pickled resource as returned by CMT_PickleResource. * resourceID * A pointer to a pre-allocated CMUint32 where the library can * place the resource ID of the re-instantiated resource. * NOTES * This function sends a message to the psm server requesting a pickled * resource be unpickled and re-instantiated. * * RETURN * A return value of CMTSuccess indicates the psm server successfully * re-instantiated a resource and the ID of the re-instantiated resource can * be found at *resourceID. Any other return value indicates an error * and the value at *resourceID should be ignored. */CMTStatus CMT_UnpickleResource(PCMT_CONTROL control, CMUint32 resourceType, CMTItem pickledResource, CMUint32 * resourceID);/* * FUNCTION: CMT_DuplicateResource * ------------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * resourceID * The resource ID of the resource to duplicate. * newResID * A pointer to a pre-allocated CMUint32 where the library can place * a copy of the duplicated resource's ID. * * NOTES * This function requests the resource passed in be duplicated and returns * the resource ID of the duplicated resource. * * RETURN * A return value of CMTSuccess indicates the resource was duplicated and * the application can refer to the resource stored at *newResID. The * application must also call CMT_DestroyResource when the new resource is * no longer needed. Any other return value indicates an error and the * value at *newResID should be ignored. */CMTStatus CMT_DuplicateResource(PCMT_CONTROL control, CMUint32 resourceID, CMUint32 *newResID);/* * FUNCTION: CMT_DestroyDataConnection * ----------------------------------- * INPUTS: * control * A control connection that has established a connection with the * psm server. * sock * The File socket the application is using * to read data from the psm server. * NOTES * This function destroys a data connection between the psm server and * the application. A Data Connection is created when an * SSL connection is established with the psm server. After an SSL * connection is no longer necessary, the application should * pass that socket to this function */int CMT_DestroyDataConnection(PCMT_CONTROL control, CMTSocket sock);/* * FUNCTION: CMT_CompareForRedirect * -------------------------------- * INPUTS * control * A control connection that has established a connection with the * psm server. * status1 * A pickled socket status resource that will be used as the first * source for the re-direct comparison. * status2 * A pickled socket status resource that will be used as the second * source for the re-direct comparison. * NOTES * This function takes two pickled SSL Socket status resources. The pickled * socket status should be a value obtained via the function * CMT_GetSSLSocketStatus. * * RETURN * A return value of CMTSuccess indicates a message was successfully sent and * retrieved from the psm server. If the value at *res is 0 then the * comparison for re-direction was unsuccessful and the user may be getting * re-directed to an un-safe location. Any other value for *res indicates * a safe re-direction. Any other return value from this function indicates an * error and that the value at *res should be ingored. */CMTStatus CMT_CompareForRedirect(PCMT_CONTROL control, CMTItem *status1, CMTItem *status2, CMUint32 *res);/* * FUNCTION: CMT_DecodeAndAddCRL * ----------------------------- * INPUTS * control * A control connection that has established a connection with the * psm server. * derCrl * The DER encoded CRL to add. * len * The length of the DER encoded CRL. * url * The URL associated with the URL being decoded. * type * An integer representation of the type of CRL that is being decoded. * errMessage * A pointer to a pre-allocated char* where the libraries can place * an error message that the application can display to the user in * case of an error. * * NOTES * This function takes a DER encoded CRL and sends it to the psm server which * then decodes the CRL and tries to import into its profile. * * Valid values for type are as follows: * Value Meaning * ----- ------- * 0 This a Key Revocation List (KRL) * 1 This a Certificate Revocation List (CRL) * * RETURN: * A return value of CMTSuccess indicates the CRL was successfully decoded and * imported into the current profile. Any other return value indicates * failure. */CMTStatus CMT_DecodeAndAddCRL(PCMT_CONTROL control, unsigned char *derCrl, CMUint32 len, char *url, int type, char **errMess);/* * FUNCTION: CMT_LogoutAllTokens * ----------------------------- * INPUTS * control * A control connection that has established a connection with the * psm server. * NOTES * This function will send a message to the psm server requesting the psm * server log out of all installed PKCS11 tokens. (ie the internal key * database and any smart cards being used.) * * RETURN * A return value of CMTSuccess indicates the psm server successfully logged * out of all the tokens. Any other return value indicates an error while * trying to log out of the tokens. */CMTStatus CMT_LogoutAllTokens(PCMT_CONTROL control);/* * FUNCTION: CMT_GetSSLCapabilites * ------------------------------- * INPUTS * control * A control connection that has established a connection with the * psm server. * capabilities * A pointer to a pre-allocated CMUint32 where the library can place * the resulting bit mask which represents the SSL capablities of the * psm server. * NOTES * The function returns a bit mask via *capabilities which tells the user * which SSL ciphers are enabled. * * Relevent Cipher Value * ----- -------- ----- * RSA 0x00000001L * MD2 0x00000010L * MD5 0x00000020L * RC2_CBC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -