Ошибка загрузки p12 в WAS Liberty в bluemix: java.io.IOException: недостаточно данных

Я пытаюсь загрузить p12 для отправки уведомлений APNS с:

InputStream in = new FileInputStream(certPath);
KeyStore ks = KeyStore.getInstance("PKCS12");
ks.load(in, certPass.toCharArray());

Ошибка при выполнении в среде исполнения Bluemix с IBM JDK.

java.io.IOException: insufficient data
at com.ibm.security.util.DerInputBuffer.truncate(Unknown Source)
at com.ibm.security.util.DerValue.(Unknown Source)
at com.ibm.security.util.DerInputStream.getDerValue(Unknown Source)
at com.ibm.security.pkcs12.BasicPFX.decode(Unknown Source)
at com.ibm.security.pkcs12.PFX.decode(Unknown Source)
at com.ibm.security.pkcsutil.PKCSDerObject.decode(Unknown Source)
at com.ibm.security.pkcs12.PFX.(Unknown Source)
at com.ibm.crypto.provider.PKCS12KeyStoreOracle.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)

Ошибка при выполнении в среде исполнения bluemix с помощью openjdk:

java.io.IOException: insufficient data
at sun.security.util.DerInputBuffer.truncate(DerInputBuffer.java:125)
at sun.security.util.DerInputStream.subStream(DerInputStream.java:136)
at sun.security.util.DerInputStream.readVector(DerInputStream.java:381)
at sun.security.util.DerInputStream.getSequence(DerInputStream.java:298)
at sun.security.pkcs.ContentInfo.(ContentInfo.java:132)
at sun.security.pkcs.ContentInfo.(ContentInfo.java:109)
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1247)
at java.security.KeyStore.load(KeyStore.java:1214)

Ejecutando un listado del contenido del amacen:

keytool -list -keystore apns-certificate-sandbox.p12 -storepass **** - тип магазина PKCS12 -v

Tipo de Almac▒n de Claves: PKCS12
Proveedor de Almac▒n de Claves: SunJSSE

Su almac▒n de claves contiene 1 entrada

Tipo de Entrada: PrivateKeyEntry
Longitud de la Cadena de Certificado: 1
Certificado[1]:
Propietario: C=US, OU=HK5F55SZAU, CN=Apple Development IOS Push Services: com.kramagot.test, UID=com.kramagot.test
Emisor: CN=Apple Worldwide Developer Relations Certification Authority, OU=Apple Worldwide Developer Relations, O=Apple Inc., C=US
...
 Nombre del Algoritmo de Firma: SHA1withRSA
         Versi▒n: 3
...

0 ответов

Другие вопросы по тегам