What is MIME type "application/pgp-keys"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
application/pgp-keys is the MIME type for files that hold PGP public keys.It lets programs exchange and import public encryption keys. These keys let you verify digital signatures and encrypt messages without revealing your private key.
Files in this format are used with encryption software like GNU Privacy Guard (GPG). They are essential when setting up secure email or file transmission.
Examples include files with extensions such as PUB, ASC, GPG, PGP, and AEXPK.
- Secure Communication: Exchange keys to encrypt emails and files.
- Digital Verification: Confirm that messages and software are authentic.
- Key Management: Import public keys into encryption tools for safe communication.
Associated file extensions
.pub, .asc, .gpg, .pgp, .aexpk
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: application/pgp-keys
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="application/pgp-keys">Download file</a>
Server-side (Node.js)
Setting the Content-Type header in Node.js:
const http = require('http');
http.createServer((req, res) => {
res.setHeader('Content-Type', 'application/pgp-keys');
res.end('Content here');
}).listen(3000);
Associated file extensions
.pub, .asc, .gpg, .pgp, .aexpk
FAQs
What is the correct MIME type for PGP public keys?
The standard MIME type for PGP public keys is application/pgp-keys. This tells web browsers and email clients that the file contains a public encryption key, allowing compatible software like GPG to import it automatically.
How do I configure Apache to serve PGP keys correctly?
You can add the MIME type definition to your .htaccess file or main configuration. Add the line: AddType application/pgp-keys .asc .pub .gpg .pgp. This ensures files with these extensions are served with the correct headers.
How do I add support for application/pgp-keys in Nginx?
Open your mime.types file or the types block in your nginx.conf. Add the following line: application/pgp-keys asc pub gpg pgp;. Reload Nginx to apply the changes.
Is it safe to host a file with the application/pgp-keys MIME type publicly?
Yes, this MIME type is specifically designed for public keys, which are meant to be shared. Sharing a public key allows others to send you encrypted messages or verify your digital signatures. Never share your private key.
Which file extensions use the application/pgp-keys MIME type?
This type is commonly associated with ASCII-armored files like asc and pub. It is also used for binary keyrings such as gpg, pgp, and aexpk.
Why does my browser download the key file instead of displaying it?
Browsers generally treat application/ MIME types as files to be saved rather than displayed. If you want users to view the key text in the browser, you might need to set the Content-Disposition header to inline or serve ASCII-armored keys as text/plain.
What is the difference between application/pgp-keys and application/pgp-signature?
application/pgp-keys is used for the encryption key itself. In contrast, application/pgp-signature is used for detached signatures (often .sig files) that verify the integrity of a different file using that key.
General FAQ
What is a MIME type?
A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.
MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.
MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.
How do I find the MIME type for a file?
You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.
Why are multiple MIME types listed for one extension?
Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.