in src/main/java/com/aws/sap/sample/lambda/sap/oauth/S3KeyStoreHandler.java [33:53]
public Map<String,Object> getKeys(Properties props) throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException {
Map<String,Object> keys = new HashMap<String,Object>();
String bucket = PropertyHandler.getValue(props, PropertyHandler.CFG_AWS_BUCKET);
String keyfile = PropertyHandler.getValue(props, PropertyHandler.CFG_AWS_KEY_FILE);
String certfile = PropertyHandler.getValue(props, PropertyHandler.CFG_AWS_CERT_FILE);
PrivateKey privateKey = null;
try {
privateKey = (PrivateKey) getPrivateKey(bucket,keyfile);
} catch (InvalidKeySpecException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
X509Certificate pubKey = (X509Certificate) getPublicKey(bucket,certfile);
keys.put(KS_PRIVATE_KEY, privateKey );
keys.put(KS_PUBLIC_KEY, pubKey );
return keys;
}