/** * Create a KeyInfoBean that contains an X.509 certificate or Public Key */ protected static KeyInfoBean createPublicKeyKeyInfo(X509Certificate certificate, PublicKey publicKey) { KeyInfoBean keyInfo = new KeyInfoBean(); if (certificate != null) { keyInfo.setCertificate(certificate); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); } else if (publicKey != null) { keyInfo.setPublicKey(publicKey); keyInfo.setCertIdentifer(CERT_IDENTIFIER.KEY_VALUE); } return keyInfo; }
/** * Create a KeyInfoBean that contains an X.509 certificate or Public Key */ protected static KeyInfoBean createPublicKeyKeyInfo(X509Certificate certificate, PublicKey publicKey) { KeyInfoBean keyInfo = new KeyInfoBean(); if (certificate != null) { keyInfo.setCertificate(certificate); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); } else if (publicKey != null) { keyInfo.setPublicKey(publicKey); keyInfo.setCertIdentifer(CERT_IDENTIFIER.KEY_VALUE); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance("alice.properties"); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias("alice"); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance(cryptoPropertiesFile); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias(cryptoAlias); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance(cryptoPropertiesFile); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias(cryptoAlias); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance("alice.properties"); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias("alice"); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertificate(certs[0]); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); return keyInfo; }