Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 848 Bytes

README.md

File metadata and controls

30 lines (27 loc) · 848 Bytes

This is a simplified wrapper for openpgpjs/openpgpjs

Examples

Generating New Keys

angular.module("SampleModule", ["OpenPGP"])
  .controller("SampleController", ["$scope", "$log", "$pgp", 
    function($scope, $log, $pgp) {
      $scope.user = {
        name:  'John Doe',
        email: 'johndoe@server.com',
        passphrase: 'my super secret password',
        pubkey: '',
        privkey: ''
      }
  $scope.generateKeys = function() {
    //keySize should be increased. Only using smaller size for testing
    $pgp.keygen($scope.name, $scope.email, $scope.passphrase, 512) 
		.then(function(result) {
			$scope.pubkey = result.publicKeyArmored;
		  $scope.privkey = result.privateKeyArmored;
		},
		function(error) {
  	  $log.error(error);
  	});
  }

}]);