1 31 package org.objectweb.proactive.ext.security; 32 33 import org.objectweb.proactive.core.body.UniversalBody; 34 import org.objectweb.proactive.ext.security.crypto.AuthenticationException; 35 import org.objectweb.proactive.ext.security.crypto.ConfidentialityTicket; 36 import org.objectweb.proactive.ext.security.crypto.KeyExchangeException; 37 38 import java.io.IOException ; 39 40 import java.security.PublicKey ; 41 import java.security.cert.X509Certificate ; 42 43 import java.util.ArrayList ; 44 45 46 public class InternalBodySecurity { 47 protected UniversalBody distantBody; 48 49 public InternalBodySecurity(UniversalBody distantBody) { 50 this.distantBody = distantBody; 51 } 52 53 public void initiateSession(int type, UniversalBody body) 54 throws IOException , CommunicationForbiddenException, 55 AuthenticationException, RenegotiateSessionException, 56 SecurityNotAvailableException { 57 distantBody.initiateSession(type, body); 58 } 59 60 public void terminateSession(long sessionID) 61 throws java.io.IOException , SecurityNotAvailableException { 62 distantBody.terminateSession(sessionID); 63 } 64 65 public X509Certificate getCertificate() 66 throws java.io.IOException , SecurityNotAvailableException { 67 return distantBody.getCertificate(); 68 } 69 70 public ProActiveSecurityManager getProActiveSecurityManager() 71 throws SecurityNotAvailableException, IOException { 72 return distantBody.getProActiveSecurityManager(); 73 } 74 75 public Policy getPolicyFrom(X509Certificate certificate) 76 throws SecurityNotAvailableException, IOException { 77 return distantBody.getPolicyFrom(certificate); 78 } 79 80 public Communication getPolicyTo(String type, String from, String to) 81 throws SecurityNotAvailableException, IOException { 82 return distantBody.getPolicyTo(type, from, to); 83 } 84 85 public long startNewSession(Communication policy) 86 throws SecurityNotAvailableException, IOException , 87 RenegotiateSessionException { 88 return distantBody.startNewSession(policy); 89 } 90 91 public ConfidentialityTicket negociateKeyReceiverSide( 92 ConfidentialityTicket confidentialityTicket, long sessionID) 93 throws SecurityNotAvailableException, KeyExchangeException, IOException { 94 return distantBody.negociateKeyReceiverSide(confidentialityTicket, 95 sessionID); 96 } 97 98 public PublicKey getPublicKey() 99 throws SecurityNotAvailableException, IOException { 100 return distantBody.getPublicKey(); 101 } 102 103 public byte[] randomValue(long sessionID, byte[] cl_rand) 104 throws Exception { 105 return distantBody.randomValue(sessionID, cl_rand); 106 } 107 108 public byte[][] publicKeyExchange(long sessionID, UniversalBody dBody, 109 byte[] my_pub, byte[] my_cert, byte[] sig_code) 110 throws Exception { 111 return distantBody.publicKeyExchange(sessionID, dBody, my_pub, my_cert, 112 sig_code); 113 } 114 115 public byte[][] secretKeyExchange(long sessionID, byte[] tmp, byte[] tmp1, 116 byte[] tmp2, byte[] tmp3, byte[] tmp4) throws Exception { 117 return distantBody.secretKeyExchange(sessionID, tmp, tmp1, tmp2, tmp3, 118 tmp4); 119 } 120 121 public void setDistantBody(UniversalBody distantBody) { 122 this.distantBody = distantBody; 123 } 124 125 public boolean isLocalBody() { 126 return distantBody == null; 127 } 128 129 132 public UniversalBody getDistantBody() { 133 return distantBody.getRemoteAdapter(); 134 } 135 136 public String getVNName() throws IOException , SecurityNotAvailableException { 137 return distantBody.getVNName(); 138 } 139 140 143 public byte[] getCertificatEncoded() 144 throws IOException , SecurityNotAvailableException { 145 return distantBody.getCertificateEncoded(); 146 } 147 148 152 public SecurityContext getPolicy(SecurityContext securityContext) 153 throws IOException , SecurityNotAvailableException { 154 return distantBody.getPolicy(securityContext); 155 } 156 157 public ArrayList getEntities() 158 throws IOException , SecurityNotAvailableException { 159 return distantBody.getEntities(); 160 } 161 } 162 | Popular Tags |