mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-08 01:51:34 +00:00
Add example for key upload to readme
This commit is contained in:
16
README.md
16
README.md
@@ -55,7 +55,7 @@ openpgp.generateKeyPair(options).then(function(keypair) {
|
||||
});
|
||||
```
|
||||
|
||||
#### Public key lookup on HKP server
|
||||
#### Lookup public key on HKP server
|
||||
```js
|
||||
var openpgp = require('openpgp');
|
||||
var hkp = new openpgp.HKP('https://pgp.mit.edu');
|
||||
@@ -67,6 +67,20 @@ hkp.lookup({
|
||||
});
|
||||
```
|
||||
|
||||
#### Upload public key to HKP server
|
||||
```js
|
||||
var openpgp = require('openpgp');
|
||||
var hkp = new openpgp.HKP('https://pgp.mit.edu');
|
||||
|
||||
var key = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----';
|
||||
|
||||
hkp.upload(key).then(function() {
|
||||
// success
|
||||
}).catch(function(error) {
|
||||
// failure
|
||||
});
|
||||
```
|
||||
|
||||
#### Encryption
|
||||
```js
|
||||
var openpgp = require('openpgp');
|
||||
|
||||
Reference in New Issue
Block a user