The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

I need to sign XML-file with XADES BES algorithm.

In 1C dev guide I have found that I can use CryptoManger

Quote
CryptoManager
Main
Syntax:

New CryptoManager(<CryptoprotectionModuleName>, <CryproprotectionModulePath>, <CryptoprotectionModuleType>)
Parameters:

<CryptoprotectionModuleName> (required)

Type: String.
The name of the cryptoprotection module. Name is case insensitive.
It is used on MS Windows.
<CryproprotectionModulePath> (required)

Type: String.
Path to a library file, implementing the required set of functions. If multiple library files are specified, they should be colon (":") separated.
The list of libraries can include files that do not exist. If a library file is not found, an error does not occur.
It is used on Linux.
<CryptoprotectionModuleType> (required)

Type: Number.
Defines type of cryptoprotection module.
Description:

If cryptoprotection module is not found, the exception is generated.

I understand that I have to fill 2 of 3 parameters depending of the system I use.
Could you please provide some examples for Windows and for Linux how to create this object.

I have seen example, but it is for some Russian Crypto module which we do not use.
Code
CryptoManager = New CryptoManager("", "", 75);


Could you please provide which strings should I use as a parameters to sign with RSA-SHA1 2048 bits and some examples as well

Quote
CryptoManager
SignAlgorithm
Usage:

Read and write.
Description:

Type: String.
Contains the specified sign algorithm.

Edited: Alexey Gerasimov - Dec 01, 2013 11:31 PM
 
#2
People who like this: 0 Yes / 0 No
Active user
1C:Professional
Rating: 6
Joined: May 8, 2013
Company: 1C Company

Working with Windows you need to use Microsoft Enhanced Cryptographic Provider (http://msdn.microsoft.com/en-us/library/windows/desktop/aa386986(v=vs.85).aspx) which CryptoprotectionModuleType is 1 and the CryptoprotectionModuleName along with CryproprotectionModulePath could be omitted. So you can just write something like this:

Code
CryptoManager = New CryptoManager("", "", 1);
On Linux the only option you have for now is CryptoPro (CryptoprotectionModuleType = 75).

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)