diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index adbf34fe..688fd3b3 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -785,8 +785,8 @@ libcrypto.pc: echo 'includedir=$${prefix}/include'; \ echo 'enginesdir=$${libdir}/engines-{- $sover -}'; \ echo ''; \ - echo 'Name: OpenSSL-libcrypto'; \ - echo 'Description: OpenSSL cryptography library'; \ + echo 'Name: GmSSL-libcrypto'; \ + echo 'Description: GmSSL cryptography library'; \ echo 'Version: '$(VERSION); \ echo 'Libs: -L$${libdir} -lcrypto'; \ echo 'Libs.private: $(EX_LIBS)'; \ @@ -798,7 +798,7 @@ libssl.pc: echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ echo ''; \ - echo 'Name: OpenSSL-libssl'; \ + echo 'Name: GmSSL-libssl'; \ echo 'Description: Secure Sockets Layer and cryptography libraries'; \ echo 'Version: '$(VERSION); \ echo 'Requires.private: libcrypto'; \ @@ -812,7 +812,7 @@ openssl.pc: echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ echo ''; \ - echo 'Name: OpenSSL'; \ + echo 'Name: GmSSL'; \ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ echo 'Version: '$(VERSION); \ echo 'Requires: libssl libcrypto' ) > openssl.pc diff --git a/Configure b/Configure index ab25aefc..73890dde 100755 --- a/Configure +++ b/Configure @@ -249,7 +249,7 @@ $config{shlib_version_history} = "unknown"; collect_information( collect_from_file(catfile($srcdir,'include/openssl/opensslv.h')), - qr/OPENSSL.VERSION.TEXT.*OpenSSL (\S+) / => sub { $config{version} = $1; }, + qr/OPENSSL.VERSION.TEXT.*GmSSL (\S+) / => sub { $config{version} = $1; }, qr/OPENSSL.VERSION.NUMBER.*(0x\S+)/ => sub { $config{version_num}=$1 }, qr/SHLIB_VERSION_NUMBER *"([^"]+)"/ => sub { $config{shlib_version_number}=$1 }, qr/SHLIB_VERSION_HISTORY *"([^"]*)"/ => sub { $config{shlib_version_history}=$1 } diff --git a/apps/openssl-vms.cnf b/apps/openssl-vms.cnf index 8fa10332..9f35aead 100644 --- a/apps/openssl-vms.cnf +++ b/apps/openssl-vms.cnf @@ -1,8 +1,7 @@ # -# OpenSSL example configuration file. +# GmSSL example configuration file. # This is mostly being used for generation of certificate requests. # -openssl_conf = openssl_init # This definition stops the following lines choking if HOME isn't # defined. @@ -16,7 +15,7 @@ oid_section = new_oids # To use this configuration file with the "-extfile" option of the # "openssl x509" utility, name here the section containing the # X.509v3 extensions to use: -# extensions = +# extensions = # (Alternatively, use a configuration file that has only # X.509v3 extensions in its main [= default] section.) @@ -53,7 +52,7 @@ serial = $dir]serial. # The current serial number crlnumber = $dir]crlnumber. # the current crl number # must be commented out to leave a V1 CRL crl = $dir]crl.pem # The current CRL -private_key = $dir.private]cakey.pem# The private key +private_key = $dir.private]cakey.pem # The private key RANDFILE = $dir.private].rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert @@ -114,7 +113,7 @@ x509_extensions = v3_ca # The extensions to add to the self signed cert # input_password = secret # output_password = secret -# This sets a mask for permitted string types. There are several options. +# This sets a mask for permitted string types. There are several options. # default: PrintableString, T61String, BMPString. # pkix : PrintableString, BMPString (PKIX recommendation before 2004) # utf8only: only UTF8Strings (PKIX recommendation after 2004). @@ -127,7 +126,7 @@ string_mask = utf8only [ req_distinguished_name ] countryName = Country Name (2 letter code) -countryName_default = AU +countryName_default = CN countryName_min = 2 countryName_max = 2 @@ -191,7 +190,7 @@ basicConstraints=CA:FALSE keyUsage = keyEncipherment # This will be displayed in Netscape's comment listbox. -nsComment = "OpenSSL Generated Certificate" +nsComment = "GmSSL Generated Certificate" # PKIX recommendations harmless if included in all certificates. subjectKeyIdentifier=hash @@ -292,7 +291,7 @@ basicConstraints=CA:FALSE # keyUsage = nonRepudiation, digitalSignature, keyEncipherment # This will be displayed in Netscape's comment listbox. -nsComment = "OpenSSL Generated Certificate" +nsComment = "GmSSL Generated Certificate" # PKIX recommendations harmless if included in all certificates. subjectKeyIdentifier=hash @@ -334,11 +333,11 @@ signer_cert = $dir/tsacert.pem # The TSA signing certificate certs = $dir.cacert.pem] # Certificate chain to include in reply # (optional) signer_key = $dir/private/tsakey.pem # The TSA private key (optional) -signer_digest = sha256 # Signing digest to use. (Optional) +signer_digest = sm3 # Signing digest to use. (Optional) default_policy = tsa_policy1 # Policy if request did not specify it # (optional) -other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) -digests = sha1, sha256, sha384, sha512 # Acceptable message digests (mandatory) +other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) +digests = sm3, sha256, sha384, sha512 # Acceptable message digests (mandatory) accuracy = secs:1, millisecs:500, microsecs:100 # (optional) clock_precision_digits = 0 # number of digits after dot. (optional) ordering = yes # Is ordering defined for timestamps? diff --git a/crypto/sof/sof_lib.c b/crypto/sof/sof_lib.c index 88a83d8d..6719c8b4 100644 --- a/crypto/sof/sof_lib.c +++ b/crypto/sof/sof_lib.c @@ -56,9 +56,9 @@ #include #include "../../e_os.h" -static long sof_sign_method = SGD_SM2; -static long sof_enc_method = SGD_SM4_CBC; -static long sof_last_error = SOR_OK; +static SOF_LONG sof_sign_method = SGD_SM2; +static SOF_LONG sof_enc_method = SGD_SM4_CBC; +static SOF_LONG sof_last_error = SOR_OK; static void *sof_app = NULL; static int sof_user_type = SGD_ROLE_USER; @@ -80,48 +80,48 @@ static int sof_decode(const char *b64, unsigned char **pdata, unsigned int *pdat } #endif -BSTR SOF_GetVersion(void) +SOF_BSTR SOF_GetVersion(void) { return OPENSSL_strdup(OpenSSL_version(0)); } -long SOF_SetSignMethod(long SignMethod) +SOF_LONG SOF_SetSignMethod(SOF_LONG SignMethod) { sof_sign_method = SignMethod; return SOR_OK; } -long SOF_GetSignMethod(void) +SOF_LONG SOF_GetSignMethod(void) { return sof_sign_method; } -long SOF_SetEncryptMethod(long EncryptMethod) +SOF_LONG SOF_SetEncryptMethod(SOF_LONG EncryptMethod) { sof_enc_method = EncryptMethod; return SOR_OK; } -long SOF_GetEncryptMethod(void) +SOF_LONG SOF_GetEncryptMethod(void) { return sof_enc_method; } /* list installed client's certificates */ -BSTR SOF_GetUserList(void) +SOF_BSTR SOF_GetUserList(void) { SOFerr(SOF_F_SOF_GETUSERLIST, SOF_R_NOT_IMPLEMENTED); return NULL; } /* we need an reference to engine */ -BSTR SOF_ExportUserCert(BSTR ContainerName) +SOF_BSTR SOF_ExportUserCert(SOF_BSTR ContainerName) { SOFerr(SOF_F_SOF_EXPORTUSERCERT, SOF_R_NOT_IMPLEMENTED); return NULL; } -BOOL SOF_Login(BSTR ContainerName, BSTR PassWd) +SOF_BOOL SOF_Login(SOF_BSTR ContainerName, SOF_BSTR PassWd) { unsigned int uiRemainCount; int rv; @@ -141,13 +141,13 @@ BOOL SOF_Login(BSTR ContainerName, BSTR PassWd) return SGD_TRUE; } -long SOF_GetPinRetryCount(BSTR ContainerName) +SOF_LONG SOF_GetPinRetryCount(SOF_BSTR ContainerName) { SOFerr(SOF_F_SOF_GETPINRETRYCOUNT, SOF_R_NOT_IMPLEMENTED); return SOR_NotSupportYetErr; } -BOOL SOF_ChangePassWd(BSTR ContainerName, BSTR OldPassWd, BSTR NewPassWd) +SOF_BOOL SOF_ChangePassWd(SOF_BSTR ContainerName, SOF_BSTR OldPassWd, SOF_BSTR NewPassWd) { int rv; unsigned int uiRemainCount; @@ -169,14 +169,14 @@ BOOL SOF_ChangePassWd(BSTR ContainerName, BSTR OldPassWd, BSTR NewPassWd) return SGD_TRUE; } -BSTR SOF_ExportExchangeUserCert(BSTR ContainerName) +SOF_BSTR SOF_ExportExchangeUserCert(SOF_BSTR ContainerName) { SOFerr(SOF_F_SOF_EXPORTEXCHANGEUSERCERT, SOF_R_NOT_IMPLEMENTED); return NULL; } /* `type` defined as SGD_CERT_XXX, SGD_EXT_XXX in sgd.h */ -BSTR SOF_GetCertInfo(BSTR Base64EncodeCert, short Type) +SOF_BSTR SOF_GetCertInfo(SOF_BSTR Base64EncodeCert, SOF_SHORT Type) { char *ret = NULL; @@ -221,25 +221,25 @@ end: return ret; } -BSTR SOF_GetCertInfoByOid(BSTR Base64EncodeCert, BSTR Oid) +SOF_BSTR SOF_GetCertInfoByOid(SOF_BSTR Base64EncodeCert, SOF_BSTR Oid) { SOFerr(SOF_F_SOF_GETCERTINFOBYOID, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_GetDeviceInfo(BSTR ContainerName, long Type) +SOF_BSTR SOF_GetDeviceInfo(SOF_BSTR ContainerName, SOF_LONG Type) { SOFerr(SOF_F_SOF_GETDEVICEINFO, SOF_R_NOT_IMPLEMENTED); return NULL; } -long SOF_ValidateCert(BSTR Base64EncodeCert) +SOF_LONG SOF_ValidateCert(SOF_BSTR Base64EncodeCert) { SOFerr(SOF_F_SOF_VALIDATECERT, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_SignData(BSTR ContainerName, BSTR InData) +SOF_BSTR SOF_SignData(SOF_BSTR ContainerName, SOF_BSTR InData) { char *ret = NULL; char *b64 = NULL; @@ -296,16 +296,16 @@ end: return ret; } -BOOL SOF_VerifySignedData(BSTR Base64EncodeCert, BSTR InData, BSTR SignValue) +SOF_BOOL SOF_VerifySignedData(SOF_BSTR Base64EncodeCert, SOF_BSTR InData, SOF_BSTR SignValue) { SOFerr(SOF_F_SOF_VERIFYSIGNEDDATA, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_SignFile(BSTR ContainerName, BSTR InFile) +SOF_BSTR SOF_SignFile(SOF_BSTR ContainerName, SOF_BSTR InFile) { - BSTR ret = NULL; + SOF_BSTR ret = NULL; char *b64 = NULL; unsigned int uiHashAlgoType = SGD_SM3; unsigned char *pucInData = NULL; @@ -346,12 +346,12 @@ end: return ret; } -BOOL SOF_VerifySignedFile(BSTR Base64EncodeCert, BSTR InFile, BSTR SignValue) +SOF_BOOL SOF_VerifySignedFile(SOF_BSTR Base64EncodeCert, SOF_BSTR InFile, SOF_BSTR SignValue) { return SGD_FALSE; } -BSTR SOF_EncryptData(BSTR Base64EncodeCert, BSTR InData) +SOF_BSTR SOF_EncryptData(SOF_BSTR Base64EncodeCert, SOF_BSTR InData) { #if 0 char *ret = NULL; @@ -376,13 +376,13 @@ BSTR SOF_EncryptData(BSTR Base64EncodeCert, BSTR InData) return NULL; } -BSTR SOF_DecryptData(BSTR ContainerName, BSTR InData) +SOF_BSTR SOF_DecryptData(SOF_BSTR ContainerName, SOF_BSTR InData) { SOFerr(SOF_F_SOF_DECRYPTDATA, SOF_R_NOT_IMPLEMENTED); return NULL; } -BOOL SOF_EncryptFile(BSTR Base64EncodeCert, BSTR InFile, BSTR OutFile) +SOF_BOOL SOF_EncryptFile(SOF_BSTR Base64EncodeCert, SOF_BSTR InFile, SOF_BSTR OutFile) { int ret = SGD_FALSE; #if 0 @@ -415,48 +415,48 @@ end: return ret; } -BOOL SOF_DecryptFile(BSTR ContainerName, BSTR InFile, BSTR OutFile) +SOF_BOOL SOF_DecryptFile(SOF_BSTR ContainerName, SOF_BSTR InFile, SOF_BSTR OutFile) { int ret = SGD_FALSE; return ret; } -BSTR SOF_SignMessage(short flag, BSTR ContainerName, BSTR InData) +SOF_BSTR SOF_SignMessage(SOF_SHORT flag, SOF_BSTR ContainerName, SOF_BSTR InData) { SOFerr(SOF_F_SOF_SIGNMESSAGE, SOF_R_NOT_IMPLEMENTED); return NULL; } -BOOL SOF_VerifySignedMessage(BSTR MessageData, BSTR InData) +SOF_BOOL SOF_VerifySignedMessage(SOF_BSTR MessageData, SOF_BSTR InData) { SOFerr(SOF_F_SOF_VERIFYSIGNEDMESSAGE, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_GetInfoFromSignedMessage(BSTR SignedMessage, short Type) +SOF_BSTR SOF_GetInfoFromSignedMessage(SOF_BSTR SignedMessage, SOF_SHORT Type) { SOFerr(SOF_F_SOF_GETINFOFROMSIGNEDMESSAGE, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_SignDataXML(BSTR ContainerName, BSTR InData) +SOF_BSTR SOF_SignDataXML(SOF_BSTR ContainerName, SOF_BSTR InData) { return NULL; } -BOOL SOF_VerifySignedDataXML(BSTR InData) +SOF_BOOL SOF_VerifySignedDataXML(SOF_BSTR InData) { SOFerr(SOF_F_SOF_VERIFYSIGNEDDATAXML, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_GetXMLSignatureInfo(BSTR XMLSignedData, short Type) +SOF_BSTR SOF_GetXMLSignatureInfo(SOF_BSTR XMLSignedData, SOF_SHORT Type) { SOFerr(SOF_F_SOF_GETXMLSIGNATUREINFO, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_GenRandom(short RandomLen) +SOF_BSTR SOF_GenRandom(SOF_SHORT RandomLen) { char *ret = NULL; char *b64 = NULL; @@ -476,78 +476,78 @@ end: return ret; } -long SOF_GetLastError(void) +SOF_LONG SOF_GetLastError(void) { return sof_last_error; } -long SOF_SetCertTrustList(BSTR CTLAltName, BSTR CTLContent, short CTLContentLen) +SOF_LONG SOF_SetCertTrustList(SOF_BSTR CTLAltName, SOF_BSTR CTLContent, SOF_SHORT CTLContentLen) { SOFerr(SOF_F_SOF_SETCERTTRUSTLIST, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_GetCertTrustListAltNames(void) +SOF_BSTR SOF_GetCertTrustListAltNames(void) { SOFerr(SOF_F_SOF_GETCERTTRUSTLISTALTNAMES, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_GetCertTrustList(BSTR CTLAltName) +SOF_BSTR SOF_GetCertTrustList(SOF_BSTR CTLAltName) { SOFerr(SOF_F_SOF_GETCERTTRUSTLIST, SOF_R_NOT_IMPLEMENTED); return NULL; } -long SOF_DelCertTrustList(BSTR CTLAltName) +SOF_LONG SOF_DelCertTrustList(SOF_BSTR CTLAltName) { SOFerr(SOF_F_SOF_DELCERTTRUSTLIST, SOF_R_NOT_IMPLEMENTED); return 0; } -long SOF_InitCertAppPolicy(BSTR PolicyName) +SOF_LONG SOF_InitCertAppPolicy(SOF_BSTR PolicyName) { SOFerr(SOF_F_SOF_INITCERTAPPPOLICY, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_GetServerCertificate(short CertUsage) +SOF_BSTR SOF_GetServerCertificate(SOF_SHORT CertUsage) { SOFerr(SOF_F_SOF_GETSERVERCERTIFICATE, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_SignMessageDetach(BSTR InData) +SOF_BSTR SOF_SignMessageDetach(SOF_BSTR InData) { SOFerr(SOF_F_SOF_SIGNMESSAGEDETACH, SOF_R_NOT_IMPLEMENTED); return NULL; } -long SOF_VerifySignedMessageDetach(BSTR InData, BSTR SignedMessage) +SOF_LONG SOF_VerifySignedMessageDetach(SOF_BSTR InData, SOF_BSTR SignedMessage) { SOFerr(SOF_F_SOF_VERIFYSIGNEDMESSAGEDETACH, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_CreateTimeStampRequest(BSTR InData) +SOF_BSTR SOF_CreateTimeStampRequest(SOF_BSTR InData) { SOFerr(SOF_F_SOF_CREATETIMESTAMPREQUEST, SOF_R_NOT_IMPLEMENTED); return NULL; } -BSTR SOF_CreateTimeStampResponse(BSTR TimeStampRequest) +SOF_BSTR SOF_CreateTimeStampResponse(SOF_BSTR TimeStampRequest) { SOFerr(SOF_F_SOF_CREATETIMESTAMPRESPONSE, SOF_R_NOT_IMPLEMENTED); return NULL; } -long SOF_VerifyTimeStamp(BSTR InData, BSTR tsResponseData) +SOF_LONG SOF_VerifyTimeStamp(SOF_BSTR InData, SOF_BSTR tsResponseData) { SOFerr(SOF_F_SOF_VERIFYTIMESTAMP, SOF_R_NOT_IMPLEMENTED); return 0; } -BSTR SOF_GetTimeStampInfo(BSTR tsResponseData, short type) +SOF_BSTR SOF_GetTimeStampInfo(SOF_BSTR tsResponseData, SOF_SHORT type) { SOFerr(SOF_F_SOF_GETTIMESTAMPINFO, SOF_R_NOT_IMPLEMENTED); return NULL; diff --git a/include/openssl/sgd.h b/include/openssl/sgd.h index 27960db1..2395f008 100644 --- a/include/openssl/sgd.h +++ b/include/openssl/sgd.h @@ -419,10 +419,6 @@ typedef HANDLE HCONTAINER; #define SGD_MAX_COUNT 64 #define SGD_MAX_NAME_SIZE 256 -/* SOF */ - -typedef char *BSTR; -typedef long BOOL; #endif #endif diff --git a/include/openssl/sof.h b/include/openssl/sof.h index 8db1f19d..3936a17f 100644 --- a/include/openssl/sof.h +++ b/include/openssl/sof.h @@ -55,54 +55,60 @@ #include +typedef char * SOF_BSTR; +typedef long SOF_LONG; +typedef short SOF_SHORT; +typedef SOF_LONG SOF_BOOL; + #ifdef __cplusplus extern "C" { #endif -BSTR SOF_GetVersion(void); -long SOF_SetSignMethod(long SignMethod); -long SOF_GetSignMethod(void); -long SOF_SetEncryptMethod(long EncryptMethod); -long SOF_GetEncryptMethod(void); -BSTR SOF_GetUserList(void); -BSTR SOF_ExportUserCert(BSTR ContainerName); -BOOL SOF_Login(BSTR ContainerName, BSTR PassWd); -long SOF_GetPinRetryCount(BSTR ContainerName); -BOOL SOF_ChangePassWd(BSTR ContainerName, BSTR OldPassWd, BSTR NewPassWd); -BSTR SOF_ExportExchangeUserCert(BSTR ContainerName); -BSTR SOF_GetCertInfo(BSTR Base64EncodeCert, short Type); -BSTR SOF_GetCertInfoByOid(BSTR Base64EncodeCert, BSTR Oid); -BSTR SOF_GetDeviceInfo(BSTR ContainerName, long Type); -long SOF_ValidateCert(BSTR Base64EncodeCert); -BSTR SOF_SignData(BSTR ContainerName, BSTR InData); -BOOL SOF_VerifySignedData(BSTR Base64EncodeCert, BSTR InData, BSTR SignValue); -BSTR SOF_SignFile(BSTR ContainerName, BSTR InFile); -BOOL SOF_VerifySignedFile(BSTR Base64EncodeCert, BSTR InFile, BSTR SignValue); -BSTR SOF_EncryptData(BSTR Base64EncodeCert, BSTR InData); -BSTR SOF_DecryptData(BSTR ContainerName, BSTR InData); -BOOL SOF_EncryptFile(BSTR Base64EncodeCert, BSTR InFile, BSTR OutFile); -BOOL SOF_DecryptFile(BSTR ContainerName, BSTR InFile, BSTR OutFile); -BSTR SOF_SignMessage(short flag, BSTR ContainerName, BSTR InData); -BOOL SOF_VerifySignedMessage(BSTR MessageData, BSTR InData); -BSTR SOF_GetInfoFromSignedMessage(BSTR SignedMessage, short Type); -BSTR SOF_SignDataXML(BSTR ContainerName, BSTR InData); -BOOL SOF_VerifySignedDataXML(BSTR InData); -BSTR SOF_GetXMLSignatureInfo(BSTR XMLSignedData, short Type); -BSTR SOF_GenRandom(short RandomLen); -long SOF_GetLastError(void); -long SOF_SetCertTrustList(BSTR CTLAltName, BSTR CTLContent, short CTLContentLen); -BSTR SOF_GetCertTrustListAltNames(void); -BSTR SOF_GetCertTrustList(BSTR CTLAltName); -long SOF_DelCertTrustList(BSTR CTLAltName); -long SOF_InitCertAppPolicy(BSTR PolicyName); -BSTR SOF_GetServerCertificate(short CertUsage); -BSTR SOF_SignMessageDetach(BSTR InData); -long SOF_VerifySignedMessageDetach(BSTR InData, BSTR SignedMessage); -BSTR SOF_CreateTimeStampRequest(BSTR InData); -BSTR SOF_CreateTimeStampResponse(BSTR TimeStampRequest); -long SOF_VerifyTimeStamp(BSTR InData, BSTR tsResponseData); -BSTR SOF_GetTimeStampInfo(BSTR tsResponseData, short type); +SOF_BSTR SOF_GetVersion(void); +SOF_LONG SOF_SetSignMethod(SOF_LONG SignMethod); +SOF_LONG SOF_GetSignMethod(void); +SOF_LONG SOF_SetEncryptMethod(SOF_LONG EncryptMethod); +SOF_LONG SOF_GetEncryptMethod(void); +SOF_BSTR SOF_GetUserList(void); +SOF_BSTR SOF_ExportUserCert(SOF_BSTR ContainerName); +SOF_BOOL SOF_Login(SOF_BSTR ContainerName, SOF_BSTR PassWd); +SOF_LONG SOF_GetPinRetryCount(SOF_BSTR ContainerName); +SOF_BOOL SOF_ChangePassWd(SOF_BSTR ContainerName, SOF_BSTR OldPassWd, SOF_BSTR NewPassWd); +SOF_BSTR SOF_ExportExchangeUserCert(SOF_BSTR ContainerName); +SOF_BSTR SOF_GetCertInfo(SOF_BSTR Base64EncodeCert, SOF_SHORT Type); +SOF_BSTR SOF_GetCertInfoByOid(SOF_BSTR Base64EncodeCert, SOF_BSTR Oid); +SOF_BSTR SOF_GetDeviceInfo(SOF_BSTR ContainerName, SOF_LONG Type); +SOF_LONG SOF_ValidateCert(SOF_BSTR Base64EncodeCert); +SOF_BSTR SOF_SignData(SOF_BSTR ContainerName, SOF_BSTR InData); +SOF_BOOL SOF_VerifySignedData(SOF_BSTR Base64EncodeCert, SOF_BSTR InData, SOF_BSTR SignValue); +SOF_BSTR SOF_SignFile(SOF_BSTR ContainerName, SOF_BSTR InFile); +SOF_BOOL SOF_VerifySignedFile(SOF_BSTR Base64EncodeCert, SOF_BSTR InFile, SOF_BSTR SignValue); +SOF_BSTR SOF_EncryptData(SOF_BSTR Base64EncodeCert, SOF_BSTR InData); +SOF_BSTR SOF_DecryptData(SOF_BSTR ContainerName, SOF_BSTR InData); +SOF_BOOL SOF_EncryptFile(SOF_BSTR Base64EncodeCert, SOF_BSTR InFile, SOF_BSTR OutFile); +SOF_BOOL SOF_DecryptFile(SOF_BSTR ContainerName, SOF_BSTR InFile, SOF_BSTR OutFile); +SOF_BSTR SOF_SignMessage(SOF_SHORT flag, SOF_BSTR ContainerName, SOF_BSTR InData); +SOF_BOOL SOF_VerifySignedMessage(SOF_BSTR MessageData, SOF_BSTR InData); +SOF_BSTR SOF_GetInfoFromSignedMessage(SOF_BSTR SignedMessage, SOF_SHORT Type); +SOF_BSTR SOF_SignDataXML(SOF_BSTR ContainerName, SOF_BSTR InData); +SOF_BOOL SOF_VerifySignedDataXML(SOF_BSTR InData); +SOF_BSTR SOF_GetXMLSignatureInfo(SOF_BSTR XMLSignedData, SOF_SHORT Type); +SOF_BSTR SOF_GenRandom(SOF_SHORT RandomLen); +SOF_LONG SOF_GetLastError(void); + +SOF_LONG SOF_SetCertTrustList(SOF_BSTR CTLAltName, SOF_BSTR CTLContent, SOF_SHORT CTLContentLen); +SOF_BSTR SOF_GetCertTrustListAltNames(void); +SOF_BSTR SOF_GetCertTrustList(SOF_BSTR CTLAltName); +SOF_LONG SOF_DelCertTrustList(SOF_BSTR CTLAltName); +SOF_LONG SOF_InitCertAppPolicy(SOF_BSTR PolicyName); +SOF_BSTR SOF_GetServerCertificate(SOF_SHORT CertUsage); +SOF_BSTR SOF_SignMessageDetach(SOF_BSTR InData); +SOF_LONG SOF_VerifySignedMessageDetach(SOF_BSTR InData, SOF_BSTR SignedMessage); +SOF_BSTR SOF_CreateTimeStampRequest(SOF_BSTR InData); +SOF_BSTR SOF_CreateTimeStampResponse(SOF_BSTR TimeStampRequest); +SOF_LONG SOF_VerifyTimeStamp(SOF_BSTR InData, SOF_BSTR tsResponseData); +SOF_BSTR SOF_GetTimeStampInfo(SOF_BSTR tsResponseData, SOF_SHORT type); #define SOR_OK 0x00000000 #define SOR_UnknownErr 0x0B000001