mirror of https://github.com/apache/jclouds.git
ec2 doesn't need a strict dependency on bouncycastle
This commit is contained in:
parent
27dbd46409
commit
29aef26c60
|
@ -91,12 +91,6 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jclouds.driver</groupId>
|
||||
<artifactId>jclouds-bouncycastle</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -62,7 +62,7 @@ public class WindowsLoginCredentialsFromEncryptedData implements Function<Passwo
|
|||
KeyFactory kf = crypto.rsaKeyFactory();
|
||||
PrivateKey privKey = kf.generatePrivate(keySpec);
|
||||
|
||||
Cipher cipher = crypto.cipher("RSA/NONE/PKCS1Padding");
|
||||
Cipher cipher = crypto.cipher("RSA");
|
||||
cipher.init(Cipher.DECRYPT_MODE, privKey);
|
||||
byte[] cipherText = CryptoStreams.base64(dataAndKey.getPasswordData().getPasswordData());
|
||||
byte[] plainText = cipher.doFinal(cipherText);
|
||||
|
|
|
@ -21,13 +21,12 @@ package org.jclouds.ec2.compute.functions;
|
|||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
|
||||
import org.jclouds.crypto.Crypto;
|
||||
import org.jclouds.date.DateService;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.domain.LoginCredentials;
|
||||
import org.jclouds.ec2.compute.domain.PasswordDataAndPrivateKey;
|
||||
import org.jclouds.ec2.domain.PasswordData;
|
||||
import org.jclouds.encryption.bouncycastle.BouncyCastleCrypto;
|
||||
import org.jclouds.encryption.internal.JCECrypto;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
|
@ -64,8 +63,7 @@ public class WindowsLoginCredentialsFromEncryptedDataTest {
|
|||
|
||||
@Test
|
||||
public void testApply() throws Exception {
|
||||
Crypto crypto = new BouncyCastleCrypto();
|
||||
WindowsLoginCredentialsFromEncryptedData f = new WindowsLoginCredentialsFromEncryptedData(crypto);
|
||||
WindowsLoginCredentialsFromEncryptedData f = new WindowsLoginCredentialsFromEncryptedData(new JCECrypto());
|
||||
|
||||
PasswordData passwordData = PasswordData.builder()
|
||||
.instanceId("i-2574e22a")
|
||||
|
|
Loading…
Reference in New Issue