Good day!

There is a need to implement a client for the Equifax credit history service. Maybe someone has already done something like this - it would be great to get a reference to the source code or an example implementation.

I rummaged a lot of things in the internet, but my experience with certificates, keystores and signatures is not very big.

The guys at Equifax say the following:

For a request to the service, they need a signed request using the COST / CC / PKCS7 algorithm in DER encoding.

As I understand it, in order to sign the request you need a private key and a certificate.

I have a file-storage of key information, where all this is supposed to be. File format * .pfx.

I managed to pull out a certificate, a list of alias and other information from it. But to pull out the private key does not come out.

I give an example of code with which I try to get a private key:

static final String KEYSTORE_FILE = "C:\\cert_bki.pfx"; static final String KEYSTORE_INSTANCE = "PKCS12"; static final String KEYSTORE_PWD = "pas"; static final String KEYSTORE_ALIAS = "bki"; public static void main(String[] args) throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, NoSuchProviderException { KeyStore ks = KeyStore.getInstance(KEYSTORE_INSTANCE); ks.load(new FileInputStream(KEYSTORE_FILE), KEYSTORE_PWD.toCharArray()); Key key = ks.getKey(KEYSTORE_ALIAS, KEYSTORE_PWD.toCharArray()); } 

But when doing this, I get an error:

 Exception in thread "main" java.security.UnrecoverableKeyException: Get Key failed: Cannot find any provider supporting 1.2.840.113549.1.12.1.80 at sun.security.pkcs12.PKCS12KeyStore.engineGetKey(PKCS12KeyStore.java:410) at java.security.KeyStore.getKey(KeyStore.java:1023) at com.mycompany.bki_bouncy.bkiMain.main(bkiMain.java:55) Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting 1.2.840.113549.1.12.1.80 at javax.crypto.Cipher.getInstance(Cipher.java:540) at sun.security.pkcs12.PKCS12KeyStore.engineGetKey(PKCS12KeyStore.java:345) ... 2 more 

I would appreciate any help in this matter!

    0