The following command is used to sign a string via openssl:
smime -sign -signer cert.crt -inkey key.key -engine gost -binary -noattr
Given a .cer file that was said to contain key within self how to I execute the same command?
I'd assume 2 options:
- Rewrite the command to use internal key
- Convert .cer file to .crt and extract .key from it to be used w/o rewriting existing command
Update:
The file insides are as follows:
(using openssl x509 -in cert.cer -noout -text
, replaced sensitive data with X_X_X):
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
X_X_X
Signature Algorithm: GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)
Issuer: X_X_X
Validity
X_X_X
X_X_X
Subject: X_X_X
Subject Public Key Info:
Public Key Algorithm: GOST R 34.10-2012 with 256 bit modulus
Unable to load Public Key
842D0000:error:03000072:digital envelope routines:X509_PUBKEY_get0:decode error:crypto\x509\x_pubkey.c:458:
842D0000:error:03000072:digital envelope routines:X509_PUBKEY_get0:decode error:crypto\x509\x_pubkey.c:458:
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment, Key Agreement
X509v3 Subject Alternative Name:
othername: title::<unsupported>
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication, 1.2.643.2.1.6.8.5, 1.2.643.3.61.502710.1.6.3.2, 1.2.643.3.251.1.1, 1.2.643.3.251.3
X509v3 Certificate Policies:
Policy: Class of Signing Tool KC1
1.2.643.100.114:
...
Signing Tool of Subject:
X_X_X
Signing Tool of Issuer:
signTool : X_X_X
cATool : X_X_X
signToolCert: X_X_X
cAToolCert : X_X_X
X509v3 CRL Distribution Points:
Full Name:
X_X_X
Full Name:
X_X_X
Authority Information Access:
CA Issuers - X_X_X
CA Issuers - X_X_X
X509v3 Subject Key Identifier:
X_X_X
X509v3 Authority Key Identifier:
keyid:X_X_X
DirName:X_X_X
serial:X_X_X
Signature Algorithm: GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)
Signature Value:
X_X_X