protected void storeKeyPair(String alias,KeyPair keyPair) throws ResourceException {
  try {
    JsonValue keyPairValue=new JsonValue(new HashMap<String,Object>());
    keyPairValue.put("value",KeyRepresentation.toPem(keyPair));
    JsonValue encrypted=cryptoService.encrypt(keyPairValue,cryptoCipher,cryptoAlias);
    JsonValue keyMap=new JsonValue(new HashMap<String,Object>());
    keyMap.put("keyPair",encrypted.getObject());
    storeInRepo(KEYS_CONTAINER,alias,keyMap);
  }
 catch (  Exception e) {
    throw new InternalServerErrorException(e.getMessage(),e);
  }
}

protected void storeKeyPair ( String alias , KeyPair keyPair ) throws ResourceException { try { JsonValue keyPairValue = new JsonValue ( new HashMap < String , Object > ( ) ) ; keyPairValue . put ( "value" , KeyRepresentation . toPem ( keyPair ) ) ; JsonValue encrypted = cryptoService . encrypt ( keyPairValue , cryptoCipher , cryptoAlias ) ; JsonValue keyMap = new JsonValue ( new HashMap < String , Object > ( ) ) ; keyMap . put ( "keyPair" , encrypted . getObject ( ) ) ; storeInRepo ( KEYS_CONTAINER , alias , keyMap ) ; } catch ( Exception e ) { throw new InternalServerErrorException ( e . getMessage ( ) , e ) ; } }
stores a keypair ( associated with a csr request on the specified alias ) in the repository .
