test_class.file: OpenADRSecurity/src/test/java/com/avob/openadr/security/OadrPKISecurityTest.java
test_class.identifier: OadrPKISecurityTest
test_case.body: @Test
  	public void createKeyManagerFactoryTest() throws OadrSecurityException {
  		String password = UUID.randomUUID().toString();
  		KeyManagerFactory createKeyManagerFactory = OadrPKISecurity.createKeyManagerFactory(TestUtils.TEST_KEY,
  				TestUtils.TEST_CRT, password);
  		assertNotNull(createKeyManagerFactory);
  
  		// invalid pem
  		boolean exception = false;
  		try {
  			createKeyManagerFactory = OadrPKISecurity.createKeyManagerFactory(TestUtils.TEST_CRT, TestUtils.TEST_KEY,
  					password);
  		} catch (OadrSecurityException e) {
  			exception = true;
  		}
  		assertTrue(exception);
  	}
test_case.class_method_signature: OadrPKISecurityTest.createKeyManagerFactoryTest()
test_case.full_signature: @Test public void createKeyManagerFactoryTest()
test_case.identifier: createKeyManagerFactoryTest
test_case.invocations: toString randomUUID createKeyManagerFactory assertNotNull createKeyManagerFactory assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createKeyManagerFactoryTest()
focal_class.file: OpenADRSecurity/src/main/java/com/avob/openadr/security/OadrPKISecurity.java
focal_class.identifier: OadrPKISecurity
focal_class.class_method_signature: OadrPKISecurity.OadrPKISecurity()
focal_class.full_signature: private  OadrPKISecurity()
focal_class.identifier: OadrPKISecurity
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  OadrPKISecurity()
focal_class.class_method_signature: OadrPKISecurity.parsePrivateKey(String privateKeyFilePath)
focal_class.full_signature: public static PrivateKey parsePrivateKey(String privateKeyFilePath)
focal_class.identifier: parsePrivateKey
focal_class.modifiers: public static
focal_class.parameters: (String privateKeyFilePath)
focal_class.return: PrivateKey
focal_class.signature: PrivateKey parsePrivateKey(String privateKeyFilePath)
focal_class.class_method_signature: OadrPKISecurity.parsePrivateKey(FileReader fileReader)
focal_class.full_signature: public static PrivateKey parsePrivateKey(FileReader fileReader)
focal_class.identifier: parsePrivateKey
focal_class.modifiers: public static
focal_class.parameters: (FileReader fileReader)
focal_class.return: PrivateKey
focal_class.signature: PrivateKey parsePrivateKey(FileReader fileReader)
focal_class.class_method_signature: OadrPKISecurity.parseCertificate(String certificateFilePath)
focal_class.full_signature: public static X509Certificate parseCertificate(String certificateFilePath)
focal_class.identifier: parseCertificate
focal_class.modifiers: public static
focal_class.parameters: (String certificateFilePath)
focal_class.return: X509Certificate
focal_class.signature: X509Certificate parseCertificate(String certificateFilePath)
focal_class.class_method_signature: OadrPKISecurity.parseCertificate(FileReader fileReader)
focal_class.full_signature: public static X509Certificate parseCertificate(FileReader fileReader)
focal_class.identifier: parseCertificate
focal_class.modifiers: public static
focal_class.parameters: (FileReader fileReader)
focal_class.return: X509Certificate
focal_class.signature: X509Certificate parseCertificate(FileReader fileReader)
focal_class.class_method_signature: OadrPKISecurity.createKeyStore(String privateKeyFilePath, String clientCertificatefilePath, String password)
focal_class.full_signature: public static KeyStore createKeyStore(String privateKeyFilePath, String clientCertificatefilePath, String password)
focal_class.identifier: createKeyStore
focal_class.modifiers: public static
focal_class.parameters: (String privateKeyFilePath, String clientCertificatefilePath, String password)
focal_class.return: KeyStore
focal_class.signature: KeyStore createKeyStore(String privateKeyFilePath, String clientCertificatefilePath, String password)
focal_class.class_method_signature: OadrPKISecurity.createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_class.full_signature: public static KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_class.identifier: createKeyManagerFactory
focal_class.modifiers: public static
focal_class.parameters: (String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_class.return: KeyManagerFactory
focal_class.signature: KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_class.class_method_signature: OadrPKISecurity.createTrustStore(List<String> certificates)
focal_class.full_signature: public static KeyStore createTrustStore(List<String> certificates)
focal_class.identifier: createTrustStore
focal_class.modifiers: public static
focal_class.parameters: (List<String> certificates)
focal_class.return: KeyStore
focal_class.signature: KeyStore createTrustStore(List<String> certificates)
focal_class.class_method_signature: OadrPKISecurity.createTrustManagerFactory(List<String> trustedCertificateFilePath)
focal_class.full_signature: public static TrustManagerFactory createTrustManagerFactory(List<String> trustedCertificateFilePath)
focal_class.identifier: createTrustManagerFactory
focal_class.modifiers: public static
focal_class.parameters: (List<String> trustedCertificateFilePath)
focal_class.return: TrustManagerFactory
focal_class.signature: TrustManagerFactory createTrustManagerFactory(List<String> trustedCertificateFilePath)
focal_class.class_method_signature: OadrPKISecurity.createSSLContext(String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
  			List<String> trustCertificates, String password)
focal_class.full_signature: public static SSLContext createSSLContext(String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
  			List<String> trustCertificates, String password)
focal_class.identifier: createSSLContext
focal_class.modifiers: public static
focal_class.parameters: (String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
  			List<String> trustCertificates, String password)
focal_class.return: SSLContext
focal_class.signature: SSLContext createSSLContext(String clientPrivateKeyPemFilePath, String clientCertificatePemFilePath,
  			List<String> trustCertificates, String password)
focal_class.class_method_signature: OadrPKISecurity.md5Hex(String data)
focal_class.full_signature: public static String md5Hex(String data)
focal_class.identifier: md5Hex
focal_class.modifiers: public static
focal_class.parameters: (String data)
focal_class.return: String
focal_class.signature: String md5Hex(String data)
focal_class.class_method_signature: OadrPKISecurity.generateRsaKeyPair()
focal_class.full_signature: public static KeyPair generateRsaKeyPair()
focal_class.identifier: generateRsaKeyPair
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: KeyPair
focal_class.signature: KeyPair generateRsaKeyPair()
focal_class.class_method_signature: OadrPKISecurity.generateEccKeyPair()
focal_class.full_signature: public static KeyPair generateEccKeyPair()
focal_class.identifier: generateEccKeyPair
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: KeyPair
focal_class.signature: KeyPair generateEccKeyPair()
focal_class.class_method_signature: OadrPKISecurity.generateCredentials(KeyPair caKeyPair, X509Certificate caCert,
  			String commonName, OadrPKIAlgorithm algo)
focal_class.full_signature: public static OadrUserX509Credential generateCredentials(KeyPair caKeyPair, X509Certificate caCert,
  			String commonName, OadrPKIAlgorithm algo)
focal_class.identifier: generateCredentials
focal_class.modifiers: public static
focal_class.parameters: (KeyPair caKeyPair, X509Certificate caCert,
  			String commonName, OadrPKIAlgorithm algo)
focal_class.return: OadrUserX509Credential
focal_class.signature: OadrUserX509Credential generateCredentials(KeyPair caKeyPair, X509Certificate caCert,
  			String commonName, OadrPKIAlgorithm algo)
focal_class.class_method_signature: OadrPKISecurity.generateKeyPair(String algo, int length)
focal_class.full_signature: private static KeyPair generateKeyPair(String algo, int length)
focal_class.identifier: generateKeyPair
focal_class.modifiers: private static
focal_class.parameters: (String algo, int length)
focal_class.return: KeyPair
focal_class.signature: KeyPair generateKeyPair(String algo, int length)
focal_class.class_method_signature: OadrPKISecurity.signCsr(PKCS10CertificationRequest csr, KeyPair caKeyPair, X509Certificate caCert,
  			BigInteger serialNumber)
focal_class.full_signature: private static X509Certificate signCsr(PKCS10CertificationRequest csr, KeyPair caKeyPair, X509Certificate caCert,
  			BigInteger serialNumber)
focal_class.identifier: signCsr
focal_class.modifiers: private static
focal_class.parameters: (PKCS10CertificationRequest csr, KeyPair caKeyPair, X509Certificate caCert,
  			BigInteger serialNumber)
focal_class.return: X509Certificate
focal_class.signature: X509Certificate signCsr(PKCS10CertificationRequest csr, KeyPair caKeyPair, X509Certificate caCert,
  			BigInteger serialNumber)
focal_class.class_method_signature: OadrPKISecurity.writeCrtToString(X509Certificate certificate)
focal_class.full_signature: private static String writeCrtToString(X509Certificate certificate)
focal_class.identifier: writeCrtToString
focal_class.modifiers: private static
focal_class.parameters: (X509Certificate certificate)
focal_class.return: String
focal_class.signature: String writeCrtToString(X509Certificate certificate)
focal_class.class_method_signature: OadrPKISecurity.writeKeyToString(KeyPair pair)
focal_class.full_signature: private static String writeKeyToString(KeyPair pair)
focal_class.identifier: writeKeyToString
focal_class.modifiers: private static
focal_class.parameters: (KeyPair pair)
focal_class.return: String
focal_class.signature: String writeKeyToString(KeyPair pair)
focal_class.class_method_signature: OadrPKISecurity.writePemToString(String type, byte[] content)
focal_class.full_signature: private static String writePemToString(String type, byte[] content)
focal_class.identifier: writePemToString
focal_class.modifiers: private static
focal_class.parameters: (String type, byte[] content)
focal_class.return: String
focal_class.signature: String writePemToString(String type, byte[] content)
focal_class.class_method_signature: OadrPKISecurity.writeToFile(String fileName, String fileExtension, String content)
focal_class.full_signature: private static File writeToFile(String fileName, String fileExtension, String content)
focal_class.identifier: writeToFile
focal_class.modifiers: private static
focal_class.parameters: (String fileName, String fileExtension, String content)
focal_class.return: File
focal_class.signature: File writeToFile(String fileName, String fileExtension, String content)
focal_class.class_method_signature: OadrPKISecurity.generateCsr(KeyPair pair, String x509PrincipalName, String algo)
focal_class.full_signature: private static PKCS10CertificationRequest generateCsr(KeyPair pair, String x509PrincipalName, String algo)
focal_class.identifier: generateCsr
focal_class.modifiers: private static
focal_class.parameters: (KeyPair pair, String x509PrincipalName, String algo)
focal_class.return: PKCS10CertificationRequest
focal_class.signature: PKCS10CertificationRequest generateCsr(KeyPair pair, String x509PrincipalName, String algo)
focal_class.class_method_signature: OadrPKISecurity.parsePem(FileReader fileReader)
focal_class.full_signature: private static Object parsePem(FileReader fileReader)
focal_class.identifier: parsePem
focal_class.modifiers: private static
focal_class.parameters: (FileReader fileReader)
focal_class.return: Object
focal_class.signature: Object parsePem(FileReader fileReader)
focal_method.body: public static KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password) throws OadrSecurityException {
  		KeyManagerFactory kmf = null;
  		try {
  			KeyStore ks = OadrPKISecurity.createKeyStore(clientPrivateKeyPemFilePath, clientCertificatePemFilePath,
  					password);
  
  			kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  			kmf.init(ks, password.toCharArray());
  			return kmf;
  		} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException
  				| UnrecoverableKeyException e) {
  			throw new OadrSecurityException(e);
  		}
  	}
focal_method.class_method_signature: OadrPKISecurity.createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_method.full_signature: public static KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_method.identifier: createKeyManagerFactory
focal_method.invocations: createKeyStore getInstance getDefaultAlgorithm init toCharArray
focal_method.modifiers: public static
focal_method.parameters: (String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)
focal_method.return: KeyManagerFactory
focal_method.signature: KeyManagerFactory createKeyManagerFactory(String clientPrivateKeyPemFilePath,
  			String clientCertificatePemFilePath, String password)