Skip to content

Instantly share code, notes, and snippets.

@isra17
Created August 17, 2013 19:06
Show Gist options
  • Save isra17/6258299 to your computer and use it in GitHub Desktop.
Save isra17/6258299 to your computer and use it in GitHub Desktop.
var keys = openpgp.keyring.privateKeys;
var lastKey = keys.length > 0?
keys[keys.length - 1]: null;
if(lastKey) {
var pubKey = lastKey.obj.extractPublicKey();
var keyName = lastKey.obj.userIds.length > 0? lastKey.obj.userIds[0].text: 'Unnamed key';
$('#homeSpan .key-name').text(keyName);
$('#homeSpan .pub-key').text(pubKey);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment