Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Hash Function

Forum

Search UsersRules
Hash Function
#1
Interested
Points:: 0
Joined:: Nov 10, 2011

Hello!

I could not find methodical documentation about HashFunction.SHA256. Could somebody write a few examples?

Thanks!

Lioudmila

Profile
#2
Active user
Points:: 0
Joined:: Nov 19, 2012

Code
HashObject = New DataHashing(HashFunction.SHA256);
//First option - get hash fr om the file
HashObject.AppendFile("<path to the file>");
//Second option - get hash from the string
HashObject.Append("My string");
BinaryHash = HashObject.HashSum;

Wh ere BinaryHash is your hash in binary form.
One of the ways to get it as string is to convert it into the Base64 form:
Code
StringRepresentation = Base64String(BinaryHash);

Profile
#3
Active user
Points:: 0
Joined:: Mar 10, 2017

Alexey, hello! Please advise how can I run DataHashing class in 1c. There is no such class.

Thank you!
Alex

Profile
#4
Guest
Points::
Joined::

Hello, Alex, you should execute the script that Alexey provided on server.

Profile
#5
Interested
Points:: 0
Joined:: Nov 10, 2011

Hello!

Thank you for the answers!

It ist very useful, but I have more information about this task. The real challenge is reading and writing of signatures using a smart card. This smart card is a chip and is placed in an USB-Stick. The chip looks like in bank cards or sim-cards.

In java there is some library

Code
sun.security.pkcs11.SunPKCS11


I really have no idea how it should work. Additional information that I have is java-technology
Package javax.smartcardio
Java™ Smart Card I/O API

In C++ there are Standard Windows library (winscard).

I can not say more about this subject. Maybe somebody has experience? Or at least if it generally works using 1C?

Thanks a lot in advance!

Profile
#6
Guest
Points::
Joined::

Hello, Lioudmila!

Which model of eToken do plan to use?

Usually when you use some equipment with 1C, you need a driver, built as an Add-in. You can use C++ language for example with winscard library to create an add-in.
You can find digital signature examples in 1C:Small Business.
There are some drivers in 1C:Peripheral Equipment Library, maybe they will match your equipment.
Also, there should be a Cryptographic Service Provider installed. The standards of cryptography that they support may also vary.

Hope, this helps.

Profile
#7
Interested
Points:: 0
Joined:: Nov 10, 2011

Thank you for your answer, Timofey!

This eToken is gemalto.

I have a little bit more information. This chip saves nothing, it just "signs" turnovers.

Regards,

Lioudmila

Profile
#8
Guest
Points::
Joined::

Lioudmila,

Unfortunately, as for now, to use this key, you will have to create an add-in or use third-party application for signing documents.
Please, note that to make signed documents be legally valid, you should use a certified application for signing them. It is good idea to check the EU legislation to make sure that methods that you use produce valid result.

If you are going to create an add-in for signing documents with eToken, maybe you could find some other partners ready for cooperation if declare this in the current topic.

Profile
#9
Interested
Points:: 0
Joined:: Nov 10, 2011

Hello Timofey!

Thank you for the information! It looks like it must be a very complicated developement. That's why I am considering a possibility of online-signature using HTTPConnection.

Thank you again for great support!

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



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.