| | |
| | | * |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends; |
| | | |
| | |
| | | String pinStr = configuration.getTrustStorePin(); |
| | | if (pinStr == null) |
| | | { |
| | | // This should be an Error. Otherwise, programs fails. |
| | | // Is there a Unit Test? |
| | | trustStorePIN = null; |
| | | } |
| | | else |
| | |
| | | throws DirectoryException |
| | | { |
| | | KeyStore keyStore; |
| | | FileInputStream inputStream = null; |
| | | try |
| | | { |
| | | keyStore = KeyStore.getInstance(trustStoreType); |
| | | |
| | | FileInputStream inputStream = |
| | | inputStream = |
| | | new FileInputStream(getFileForPath(trustStoreFile)); |
| | | keyStore.load(inputStream, trustStorePIN); |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | finally |
| | | { |
| | | if (inputStream != null) |
| | | { |
| | | try |
| | | { |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e){} |
| | | } |
| | | } |
| | | |
| | | |
| | | try |
| | |
| | | throws DirectoryException |
| | | { |
| | | KeyStore trustStore; |
| | | FileInputStream inputStream = null; |
| | | try |
| | | { |
| | | trustStore = KeyStore.getInstance(trustStoreType); |
| | | |
| | | FileInputStream inputStream = |
| | | inputStream = |
| | | new FileInputStream(getFileForPath(trustStoreFile)); |
| | | trustStore.load(inputStream, trustStorePIN); |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | finally |
| | | { |
| | | if (inputStream != null) |
| | | { |
| | | try |
| | | { |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e){} |
| | | } |
| | | } |
| | | |
| | | |
| | | try |
| | |
| | | throws DirectoryException |
| | | { |
| | | KeyStore trustStore; |
| | | FileInputStream inputStream = null; |
| | | try |
| | | { |
| | | trustStore = KeyStore.getInstance(trustStoreType); |
| | | |
| | | FileInputStream inputStream = |
| | | inputStream = |
| | | new FileInputStream(getFileForPath(trustStoreFile)); |
| | | trustStore.load(inputStream, trustStorePIN); |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | |
| | | finally |
| | | { |
| | | if (inputStream != null) |
| | | { |
| | | try |
| | | { |
| | | inputStream.close(); |
| | | } |
| | | catch (Exception e){} |
| | | } |
| | | } |
| | | |
| | | try |
| | | { |