OpenSSLfails on signature verification with “Unknown Option” error











up vote
1
down vote

favorite












I have three files:




  1. test.json

  2. public.pem

  3. test.json.sign (Which is the signature of test.json with a private key)


I need to verify this signature. I use the following command



dgst -sha256 -sign pub.key -signature <signature filename> <data file>


When I try this command it gives me "unable to load key file" error.



What is the problem?





P.S: I googled the problem and I found a solution on this website here



It says I need to run the following command first



openssl x509 -pubkey -noout -in cert.pem > pubkey.pem


But when I run this command it gives me "unknown option" error!










share|improve this question
























  • This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
    – JakeGould
    Nov 17 at 23:40

















up vote
1
down vote

favorite












I have three files:




  1. test.json

  2. public.pem

  3. test.json.sign (Which is the signature of test.json with a private key)


I need to verify this signature. I use the following command



dgst -sha256 -sign pub.key -signature <signature filename> <data file>


When I try this command it gives me "unable to load key file" error.



What is the problem?





P.S: I googled the problem and I found a solution on this website here



It says I need to run the following command first



openssl x509 -pubkey -noout -in cert.pem > pubkey.pem


But when I run this command it gives me "unknown option" error!










share|improve this question
























  • This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
    – JakeGould
    Nov 17 at 23:40















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have three files:




  1. test.json

  2. public.pem

  3. test.json.sign (Which is the signature of test.json with a private key)


I need to verify this signature. I use the following command



dgst -sha256 -sign pub.key -signature <signature filename> <data file>


When I try this command it gives me "unable to load key file" error.



What is the problem?





P.S: I googled the problem and I found a solution on this website here



It says I need to run the following command first



openssl x509 -pubkey -noout -in cert.pem > pubkey.pem


But when I run this command it gives me "unknown option" error!










share|improve this question















I have three files:




  1. test.json

  2. public.pem

  3. test.json.sign (Which is the signature of test.json with a private key)


I need to verify this signature. I use the following command



dgst -sha256 -sign pub.key -signature <signature filename> <data file>


When I try this command it gives me "unable to load key file" error.



What is the problem?





P.S: I googled the problem and I found a solution on this website here



It says I need to run the following command first



openssl x509 -pubkey -noout -in cert.pem > pubkey.pem


But when I run this command it gives me "unknown option" error!







openssl






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 at 23:37









JakeGould

30.7k1093135




30.7k1093135










asked Nov 17 at 23:29









user964804

61




61












  • This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
    – JakeGould
    Nov 17 at 23:40




















  • This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
    – JakeGould
    Nov 17 at 23:40


















This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
– JakeGould
Nov 17 at 23:40






This could be a character encoding issue. Look at this answer. Or just try it without the file output like this. openssl x509 -pubkey -noout -in cert.pem
– JakeGould
Nov 17 at 23:40

















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376339%2fopensslfails-on-signature-verification-with-unknown-option-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376339%2fopensslfails-on-signature-verification-with-unknown-option-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)