Question

Clarify me out here, I need to save RSA Private and Public key in Server's local Directory and I did it via getting Encoded bytes from the Keys. There is file extension part, when i searched some of 'em told that there is no need for extension for the key file and some of 'em are tell that public and private key should be of .der and .pem file formats respectively. So, help me out here to understand the differences. And i'm using Javax.Crypto API.

Was it helpful?

Solution

The file extension is simply a conventional way of distinguishing types of files: .pdf for PDF files, .html for HTML files, etc. You can use whatever extension you want (or no extension at all) to store whatever you like. It has no impact on what the file contains.

So if this file is only relevant to your own application, use whatever name and extension you like. You could use .pdf or .html if you wanted to and it wouldn't change anything (except it would be confusing).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top