new CertificateCredentialsImpl.UploadedKeyStoreSource(certificate.getEncryptedValue()));
}
@Override
public StandardCredentials toCredentials(ModelObject context, String description) throws IOException {
StandardCertificateCredentials result = toCredentials(description);
for (StandardCertificateCredentials c : CredentialsProvider.lookupCredentials(
StandardCertificateCredentials.class,
findItemGroup(context),
ACL.SYSTEM,
Collections.<DomainRequirement>emptyList())) {
if (c.getPassword().equals(result.getPassword())) {
// now for the more complex Keystore comparison
KeyStore s1 = c.getKeyStore();
KeyStore s2 = result.getKeyStore();
try {
// if the aliases differ we know it's not a match, this is a faster test than serial form
Set<String> a1 = new HashSet<String>(Collections.list(s1.aliases()));
Set<String> a2 = new HashSet<String>(Collections.list(s2.aliases()));
if (!a1.equals(a2)) {