1 package org.ejbca.core.protocol.ws.objects; 2 3 import java.io.ByteArrayOutputStream ; 4 import java.io.IOException ; 5 import java.security.KeyStoreException ; 6 import java.security.NoSuchAlgorithmException ; 7 import java.security.cert.CertificateException ; 8 9 import org.ejbca.util.Base64; 10 11 public class KeyStore { 12 13 private byte[] keystoreData = null; 14 15 public KeyStore(){ 16 17 } 18 19 public KeyStore(java.security.KeyStore keystore, String password) throws KeyStoreException , NoSuchAlgorithmException , IOException , CertificateException { 20 21 ByteArrayOutputStream baos = new ByteArrayOutputStream (); 22 keystore.store(baos,password.toCharArray()); 23 keystoreData = Base64.encode(baos.toByteArray()); 24 } 25 26 27 28 31 public byte[] getKeystoreData() { 32 return keystoreData; 33 } 34 35 38 public void setKeystoreData(byte[] keystoreData) { 39 this.keystoreData = keystoreData; 40 } 41 42 43 } 44 | Popular Tags |