private PkiMessageDecoder getDecoder(X509Certificate identity,
PrivateKey key, String profile) throws ClientException {
final CertStore store = getCaCertificate(profile);
CertStoreInspector certs = CertStoreInspector.getInstance(store);
X509Certificate signer = certs.getSigner();
PkcsPkiEnvelopeDecoder envDecoder = new PkcsPkiEnvelopeDecoder(
identity, key);
return new PkiMessageDecoder(signer, envDecoder);
}