public ConsumerDetails getObject() throws Exception {
if ("rsa-cert".equals(typeOfSecret)) {
try {
Certificate cert = CertificateFactory.getInstance("X.509").generateCertificate(resourceLoader.getResource(secret).getInputStream());
consumer.setSignatureSecret(new RSAKeySecret(cert.getPublicKey()));
}
catch (IOException e) {
throw new BeanCreationException("RSA certificate not found at " + secret + ".",
e);
}