opencoff / sigtool

Ed25519 signing, verification and encryption, decryption for arbitary files; like OpenBSD signifiy but with more functionality and written in Golang - only easier and simpler
GNU General Public License v2.0
84 stars 15 forks source link

Openssl key cannot use sigtool to sign file #1

Closed JohnPatel23 closed 6 years ago

JohnPatel23 commented 6 years ago

Sigtool cannot use openssl key to sign file.

Steps to reproduce

From shell.... openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout test-sign.key -out testsys.crt

Then, using test-sign.key, try to sign a file sigtool sign test-sign.key testfile1.txt

Returns this error.... "can't parse YAML: yaml: unmarshal errors: line 1: cannot unmarshal !!str '.....BE..' into sign.serialPrivKey'

but if I generate a key with sigtool, it's fine. Need to be able to generate and verify with openssl but sign with sigtool (or vice versa) without errors.

Not sure if this is a bug or I am missing steps. Thank you.

Env: CentOS7 sigtool build with Go 1.11

opencoff commented 6 years ago

Hello,

sigtool is a standalone tool and has no relationship or compatibility with openssl.

1) Use sigtool to first generate keys: sigtool generate -p test-sign

This generates two files: test-sign.pub and test-sign.key;

2) Sign any file using test-sign.key: sigtool sign test-sign.key testfile1.txt

This signs testfile1.txt and write signature to testfile1.txt.sig

Hope this helps,