shushlyakov
shushlyakov

Reputation: 21

Import encrypted session key

I have asn.1 structure (encrypted session key):

SEQUENCE(2 elem)
  SEQUENCE(2 elem)
    OCTET STRING(32 byte) 5E70735F3698B4355B45037FA7CE0097115E45C6585994726642063F723AB49E
    OCTET STRING(4 byte) 8C860884
  [0](3 elem)
    OBJECT IDENTIFIER1.2.643.2.2.31.1
    [0](2 elem)
      SEQUENCE(2 elem)
        OBJECT IDENTIFIER1.2.643.2.2.19
        SEQUENCE(2 elem)
          OBJECT IDENTIFIER1.2.643.2.2.36.0
          OBJECT IDENTIFIER1.2.643.2.2.30.1
      BIT STRING(1 elem)
        OCTET STRING(64 byte) 2DC3FDF69C913DCCB653268E512F5EDDE41A5DB3583CDF6068F248A2B0B8DE7BC9AA20E3CF63DF5F395521E0A0DD853E0AAF44FA493CD54CA8048D1D9C4185FB
    OCTET STRING(8 byte) 76EEB46B1B1036EB

How to decrypt this structure using the function CryptImportKey?

Upvotes: 1

Views: 119

Answers (1)

Maarten Bodewes
Maarten Bodewes

Reputation: 93948

That structure uses the Russian GOST protocols. I'm pretty certain that those are not supported by CryptImportKey out of the box. You probably have to extract the information and then import it using a structure that is supported by CryptImportKey.

For instance OID 1.2.643.2.2.19 shows {iso(1) member-body(2) ru(643) 2 cryptopro(2) gostR3410-2001(19)}.

It seems you could use some kind of plugin, probably you could obtain this from CryptoPro. I'm not sure though, my Russian is not that good (and my friend Anya is not into crypto :) ).

Upvotes: 1

Related Questions