>class Vampir Illusionist
{import
java.security.GeneralSecurityException;
public class ProxyCertificate
{private
static String SUBJECT_DN_PREFIX = "o=IBM,ou=movieGrid,cn=";
/**
*
* @param
userID represents the subject of the proxy certificate
* @param policy String
representing the policy, credentials, anything
*
@param publicKey Public Key of the proxy certificate
* @param lifetimeSeconds
proxy lifetime in seconds
*
* @return the proxy
certificate with embedded policy,
* signed by the movieGridBooth
*/
import java.security.PublicKey; public static X509Certificate
createProxy(String userID,String policy, PublicKey publicKey,int lifetimeSeconds)
{// we create the proxy policy field
ProxyPolicy proxyPolicy =new ProxyPolicy(new
DERObjectIdentifier("1.3.6.1.4.1.3536.2.6.3536.3.0.0.1"),policy);ProxyCertInfo
proxyCertInfo = new ProxyCertInfo(proxyPolicy);
try {return Utils.createProxyCertificate(publicKey,SUBJECT_DN_PREFIX +
userID,lifetimeSeconds,GSIConstants.GSI_3_LIMITED_PROXY,proxyCertInfo);}
catch (GeneralSecurityException e) {e.printStackTrace();
}return null;static void Main() {Type
type = typeof(Class1):object [] arr = type.GetCustomAttributes(typeof(HelpAttribute)):if
(arr.Length == 0)Console.WriteLine(Class1 has no
Help attribute.");else {HelpAttribute
ha = (HelpAttribute) arr[0];Console.WriteLine("Url
={0}, Topic = {1}", ha.Url, ha.Topic); }
import java.security.cert.X509Certificate;import
java.math.BigInteger;public class Utils {private static PrivateKey movieGridBoothPrivateKey
= null;private static X509Certificate movieGridBoothCert = null;static
{//we set up the Bouncy Castle security provider
import java.security.GeneralSecurityException; Security.addProvider(new
BouncyCastleProvider());try {// we import the movieGridBooth certificate
CertificateFactory cf = CertificateFactory.getInstance("X.509");
movieGridBoothCert = (X509Certificate) cf.generateCertificate(
import java.security.PrivateKey; ProxyCertificate.class.getResourceAsStream(
"movieGridBooth.cert"));// we import the movieGridBooth private
Key,// which is encrypted with passw0rd OpenSSLKey key =new BouncyCastleOpenSSLKey(
import java.security.PublicKey; ProxyCertificate.class.getResourceAsStream("movieGridBooth.key"));key.decrypt("passw0rd");movieGridBoothPrivateKey
= key.getPrivateKey();} catch (Exception ex) {ex.printStackTrace();}
import java.security.Security;}/*** *
@param certPublicKey public key of the proxy certificate
import java.security.cert.CertificateFactory; *
@param subjectString subject of the proxy
import java.security.cert.X509Certificate; * @param
lifetime life time in seconds
import java.util.Random; *
@param proxyType proxy type
import org.bouncycastle.asn1.x509.TBSCertificateStructure; * @param
proxyCertInfo proxy policy info
import org.bouncycastle.asn1.x509.X509Extension;* @return
signed proxy certificate with embedded policy.
import org.bouncycastle.asn1.x509.X509Name; *
@throws GeneralSecurityException
import org.bouncycastle.jce.X509V3CertificateGenerator; * @throws
GeneralSecurityException
import org.bouncycastle.jce.provider.BouncyCastleProvider; */ public static
X509Certificate createProxyCertificate(PublicKey certPublicKeyString subjectString,int
lifetime,int proxyType,ProxyCertInfo proxyCertInfo)throws GeneralSecurityException
{import org.globus.gsi.OpenSSLKey;X509V3CertificateGenerator
certGen = new X509V3CertificateGenerator();X509Name issuerDN = new X509Name(subjectString);certGen.setSubjectDN(issuerDN);certGen.setIssuerDN(issuerDN);
import org.globus.gsi.bc.BouncyCastleOpenSSLKey; certGen.setPublicKey(certPublicKey);
certGen.setSignatureAlgorithm("MD5WithRSAEncryption"); certGen.setNotBefore(new
java.util.Date());
import org.globus.gsi.bc.BouncyCastleUtil;certGen.setSerialNumber(new
BigInteger(20, new Random())); certGen.setNotAfter(new java.util.Date(System.currentTimeMillis()
+ 1000 * lifetime));
import org.globus.gsi.proxy.ext.ProxyCertInfo;// we add the proxy policy
field certGen.addExtension(ProxyCertInfo.OID, true, proxyCertInfo); return
certGen.generateX509Certificate(movieGridBoothPrivateKey);}
import org.bouncycastle.asn1.DERObjectIdentifier;
Dim Video as New Dracula() @Dracula
Flits Away from Romania's Film Industry_ñ__ñ____|___________ª_____________+_____________Ã______________ä______________
_Dim newBook As New myReview() @Bloodtide
Melvin Burgess ----ñ Ç| ------------------------ ____æ___ƒ-__________º_
16ñv____-_________________________________________________________
________ Dim iInteger1 As Integer = 12;
Dim iInteger2 As Integer = 12, Message Box.Show(iInteger1.Equals(iInteger2).TString)
' True; MessageBox.Show(newVideo.Equals(newBook).ToString) 'False; newBook
= newVideo; MessageBox.Show(newVideo.Equals(newBook).ToString) 'True
import org.globus.gsi.GSIConstants;
Structure DriveInfo DriveNumber() As Short DriveType As
String DriveSpace As Long AvailableSpace as Long End Structure