use of uk.gov.ida.common.shared.configuration.DeserializablePublicKeyConfiguration in project verify-hub by alphagov.
the class SignatureVerificationCertificateBuilder method build.
public SignatureVerificationCertificate build() {
String fullCert = format("-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----", x509Value.trim());
DeserializablePublicKeyConfiguration configuration = mock(DeserializablePublicKeyConfiguration.class);
when(configuration.getCert()).thenReturn(fullCert);
return new SignatureVerificationCertificate(configuration);
}
use of uk.gov.ida.common.shared.configuration.DeserializablePublicKeyConfiguration in project verify-hub by alphagov.
the class SamlEngineModule method getKeyStore.
@Provides
@Singleton
private IdaKeyStore getKeyStore(X509CertificateFactory certificateFactory, SamlEngineConfiguration configuration) {
Map<KeyPosition, PrivateKey> privateKeyStore = privateEncryptionKeys(configuration);
DeserializablePublicKeyConfiguration publicSigningKeyConfiguration = configuration.getPublicSigningCert();
String encodedSigningCertificate = publicSigningKeyConfiguration.getCert();
X509Certificate signingCertificate = encodedSigningCertificate != null ? certificateFactory.createCertificate(encodedSigningCertificate) : null;
KeyPair primaryEncryptionKeyPair = Crypto.keyPairFromPrivateKey(privateKeyStore.get(KeyPosition.PRIMARY));
KeyPair secondaryEncryptionKeyPair = Crypto.keyPairFromPrivateKey(privateKeyStore.get(KeyPosition.SECONDARY));
KeyPair signingKeyPair = Crypto.keyPairFromPrivateKey(privateSigningKey(configuration));
return new IdaKeyStore(signingCertificate, signingKeyPair, asList(primaryEncryptionKeyPair, secondaryEncryptionKeyPair));
}
Aggregations