1 21 package org.jacorb.security.level2; 22 23 import java.security.PrivateKey ; 24 import java.security.cert.Certificate ; 25 26 35 36 public class KeyAndCert 37 { 38 public PrivateKey key = null; 40 41 public Certificate [] chain = null; 42 43 public KeyAndCert( PrivateKey key, 44 Certificate [] chain ) 45 { 46 this.key = key; 47 this.chain = chain; 48 } 49 50 public KeyAndCert( KeyAndCert source ) 51 { 52 this.key = source.key; 53 54 chain = new Certificate [ source.chain.length ]; 55 System.arraycopy( source.chain, 0, chain, 0, source.chain.length ); 56 } 57 58 public String toString() 59 { 60 StringBuffer sb = new StringBuffer (); 61 for( int i = 0; i < chain.length; i++ ) 62 { 63 sb.append( chain[i].toString() ); 64 } 65 return sb.toString(); 66 } 67 68 72 73 public java.security.PublicKey getPublicKey() 74 { 75 if( chain.length > 0 ) 76 return chain[0].getPublicKey(); 77 else 78 return null; 79 } 80 81 82 } 84 85 86 87 88 89 | Popular Tags |