Skip to content

Commit

Permalink
Showing 5 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -133,7 +133,8 @@ public final KeyStore getKeyStore ()
{
ret = m_aKeyStore = KeyStoreHelper.loadKeyStore (m_aCryptoProps.getKeyStoreType (),
m_aCryptoProps.getKeyStorePath (),
m_aCryptoProps.getKeyStorePassword ()).getKeyStore ();
m_aCryptoProps.getKeyStorePassword ())
.getKeyStore ();
}
return ret;
}
@@ -151,8 +152,8 @@ public final KeyStore.PrivateKeyEntry getPrivateKeyEntry ()
ret = m_aPK = KeyStoreHelper.loadPrivateKey (aKeyStore,
m_aCryptoProps.getKeyStorePath (),
m_aCryptoProps.getKeyAlias (),
sKeyPassword == null ? ArrayHelper.EMPTY_CHAR_ARRAY : sKeyPassword
.toCharArray ())
sKeyPassword == null ? ArrayHelper.EMPTY_CHAR_ARRAY
: sKeyPassword.toCharArray ())
.getKeyEntry ();
}
}
@@ -177,6 +178,7 @@ public final String getKeyPassword ()
* @see #getPrivateKeyEntry()
*/
@Nullable
@Deprecated (forRemoval = true, since = "2.6.0")
public final X509Certificate getCertificate ()
{
final KeyStore.PrivateKeyEntry aPK = getPrivateKeyEntry ();
@@ -191,7 +193,8 @@ public final KeyStore getTrustStore ()
{
ret = m_aTrustStore = KeyStoreHelper.loadKeyStore (m_aCryptoProps.getTrustStoreType (),
m_aCryptoProps.getTrustStorePath (),
m_aCryptoProps.getTrustStorePassword ()).getKeyStore ();
m_aCryptoProps.getTrustStorePassword ())
.getKeyStore ();
}
return ret;
}
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ public interface IAS4CryptoFactory
* alias. May be <code>null</code>.
*/
@Nullable
@Deprecated (forRemoval = true, since = "2.6.0")
String getKeyPassword ();

/**
Original file line number Diff line number Diff line change
@@ -102,7 +102,8 @@ private static Document _createSignedMessage (@Nonnull final IAS4CryptoFactory a

aBuilder.setKeyIdentifierType (aSigningParams.getKeyIdentifierType ().getTypeID ());
// Set keystore alias and key password
aBuilder.setUserInfo (aCryptoFactorySign.getKeyAlias (), aCryptoFactorySign.getKeyPassword ());
aBuilder.setUserInfo (aCryptoFactorySign.getKeyAlias (),
aCryptoFactorySign.getKeyPasswordPerAlias (aCryptoFactorySign.getKeyAlias ()));
aBuilder.setSignatureAlgorithm (aSigningParams.getAlgorithmSign ().getAlgorithmURI ());
// PMode indicates the DigestAlgorithm as Hash Function
aBuilder.setDigestAlgo (aSigningParams.getAlgorithmSignDigest ().getAlgorithmURI ());
Original file line number Diff line number Diff line change
@@ -105,7 +105,8 @@ public void testEncryptionDecryptionAES128GCM () throws Exception
final WSSecEncrypt aBuilder = new WSSecEncrypt (aSecHeader);
aBuilder.setKeyIdentifierType (ECryptoKeyIdentifierType.ISSUER_SERIAL.getTypeID ());
aBuilder.setSymmetricEncAlgorithm (ECryptoAlgorithmCrypt.AES_128_GCM.getAlgorithmURI ());
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (), aCryptoFactory.getKeyPassword ());
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (),
aCryptoFactory.getKeyPasswordPerAlias (aCryptoFactory.getKeyAlias ()));

// final WSEncryptionPart encP = new WSEncryptionPart ("Messaging",
// "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/",
@@ -136,7 +137,8 @@ public void testAES128GCM () throws Exception

final WSSecEncrypt aBuilder = new WSSecEncrypt (secHeader);
// builder.setUserInfo ("wss40");
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (), aCryptoFactory.getKeyPassword ());
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (),
aCryptoFactory.getKeyPasswordPerAlias (aCryptoFactory.getKeyAlias ()));
aBuilder.setKeyIdentifierType (ECryptoKeyIdentifierType.BST_DIRECT_REFERENCE.getTypeID ());
aBuilder.setSymmetricEncAlgorithm (ECryptoAlgorithmCrypt.AES_128_GCM.getAlgorithmURI ());

Original file line number Diff line number Diff line change
@@ -85,7 +85,8 @@ public void testX509SignatureIS () throws Exception
aSecHeader.insertSecurityHeader ();

final WSSecSignature aBuilder = new WSSecSignature (aSecHeader);
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (), aCryptoFactory.getKeyPassword ());
aBuilder.setUserInfo (aCryptoFactory.getKeyAlias (),
aCryptoFactory.getKeyPasswordPerAlias (aCryptoFactory.getKeyAlias ()));
aBuilder.setKeyIdentifierType (ECryptoKeyIdentifierType.BST_DIRECT_REFERENCE.getTypeID ());
aBuilder.setSignatureAlgorithm (ECryptoAlgorithmSign.RSA_SHA_256.getAlgorithmURI ());
// PMode indicates the DigestAlgorithmen as Hash Function

0 comments on commit 35b37bd

Please sign in to comment.