Can openssl convert SSH public key to a PEM file without private key?
So I've seen many many posts on how to do the conversion with private key; but does anyone one know how I can do this with just only public key? As I'm trying to convert someone else's public key.
Or is this something not possible and I need to ask them to generate one themselves?
ssh osx encryption openssl
add a comment |
So I've seen many many posts on how to do the conversion with private key; but does anyone one know how I can do this with just only public key? As I'm trying to convert someone else's public key.
Or is this something not possible and I need to ask them to generate one themselves?
ssh osx encryption openssl
1
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59
add a comment |
So I've seen many many posts on how to do the conversion with private key; but does anyone one know how I can do this with just only public key? As I'm trying to convert someone else's public key.
Or is this something not possible and I need to ask them to generate one themselves?
ssh osx encryption openssl
So I've seen many many posts on how to do the conversion with private key; but does anyone one know how I can do this with just only public key? As I'm trying to convert someone else's public key.
Or is this something not possible and I need to ask them to generate one themselves?
ssh osx encryption openssl
ssh osx encryption openssl
asked Feb 11 at 10:27
Praveen PPraveen P
1032
1032
1
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59
add a comment |
1
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59
1
1
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59
add a comment |
1 Answer
1
active
oldest
votes
If you are just looking to convert a public key, not create a certificate then you only need the public key.
ssh-keygen -f id_rsa.pub -e -m pem > id_rsa.pub.pem
Will read a public key file id_rsa.pub
(containing just your friend's public key) and convert it to pem format.
The private key would be needed for something like a self signed certificate (in x509 format) because it's the private key that generates the signature.
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499906%2fcan-openssl-convert-ssh-public-key-to-a-pem-file-without-private-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are just looking to convert a public key, not create a certificate then you only need the public key.
ssh-keygen -f id_rsa.pub -e -m pem > id_rsa.pub.pem
Will read a public key file id_rsa.pub
(containing just your friend's public key) and convert it to pem format.
The private key would be needed for something like a self signed certificate (in x509 format) because it's the private key that generates the signature.
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
add a comment |
If you are just looking to convert a public key, not create a certificate then you only need the public key.
ssh-keygen -f id_rsa.pub -e -m pem > id_rsa.pub.pem
Will read a public key file id_rsa.pub
(containing just your friend's public key) and convert it to pem format.
The private key would be needed for something like a self signed certificate (in x509 format) because it's the private key that generates the signature.
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
add a comment |
If you are just looking to convert a public key, not create a certificate then you only need the public key.
ssh-keygen -f id_rsa.pub -e -m pem > id_rsa.pub.pem
Will read a public key file id_rsa.pub
(containing just your friend's public key) and convert it to pem format.
The private key would be needed for something like a self signed certificate (in x509 format) because it's the private key that generates the signature.
If you are just looking to convert a public key, not create a certificate then you only need the public key.
ssh-keygen -f id_rsa.pub -e -m pem > id_rsa.pub.pem
Will read a public key file id_rsa.pub
(containing just your friend's public key) and convert it to pem format.
The private key would be needed for something like a self signed certificate (in x509 format) because it's the private key that generates the signature.
answered Feb 11 at 10:55
Philip CoulingPhilip Couling
1,211917
1,211917
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
add a comment |
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
Thank you; this is what I was looking for.
– Praveen P
Feb 11 at 11:02
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499906%2fcan-openssl-convert-ssh-public-key-to-a-pem-file-without-private-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
PEM format can wrap up a few different things. Could you clarify. Are you trying to create a certificate (x509) or are you just trying to convert the public key format?
– Philip Couling
Feb 11 at 10:43
are you trying to get a private key from a public key ? assymetric key were meant to make this impossible. Could you give more details ?
– Archemar
Feb 11 at 10:45
@PhilipCouling Sorry, I should've added what I was trying to do. It is for encrypting files to share.
– Praveen P
Feb 11 at 10:59