@Override protected Object getDecodedObject(BerInputStream in) { Object[] values = (Object[]) in.content; return new AlgorithmIdentifier(ObjectIdentifier .toString((int[]) values[0]), (byte[]) values[1]); }
@Override public String toString() { StringBuilder result = new StringBuilder(); result.append("X.509 Certificate:\n[\n"); tbsCertificate.dumpValue(result); result.append("\n Algorithm: ["); signatureAlgorithm.dumpValue(result); result.append(']'); result.append("\n Signature Value:\n"); result.append(Array.toString(signatureValue, "")); result.append(']'); return result.toString(); }
@Override public boolean equals(Object other) { if (!(other instanceof TBSCertList)) { return false; } TBSCertList that = (TBSCertList) other; return version == that.version && signature.equals(that.signature) && Arrays.equals(issuer.getEncoded(), that.issuer.getEncoded()) && thisUpdate.getTime() / 1000 == that.thisUpdate.getTime() / 1000 && (nextUpdate == null ? that.nextUpdate == null : nextUpdate.getTime() / 1000 == that.nextUpdate.getTime() / 1000) && ((revokedCertificates == null || that.revokedCertificates == null) && revokedCertificates == that.revokedCertificates || revokedCertificates.equals(that.revokedCertificates)) && (crlExtensions == null ? that.crlExtensions == null : crlExtensions.equals(that.crlExtensions)); }
@Override protected void getValues(Object object, Object[] values) { AlgorithmIdentifier aID = (AlgorithmIdentifier) object; values[0] = ObjectIdentifier.toIntArray(aID.getAlgorithm()); values[1] = aID.getParameters(); } };
public void dumpValue(StringBuilder sb) { sb.append(getAlgorithmName()); if (parameters == null) { sb.append(", no params, "); } else { sb.append(", params unparsed, "); } sb.append("OID = "); sb.append(getAlgorithm()); }
public String getDigestAlgorithmName() { return digestAlgorithm.getAlgorithmName(); }
public byte[] getSigAlgParams() { if (nullSigAlgParams) { return null; } byte[] result = sigAlgParams; if (result == null) { result = tbsCert.getSignature().getParameters(); if (result == null) { nullSigAlgParams = true; return null; } sigAlgParams = result; } return result; }
public String getDigestAlgorithm() { return digestAlgorithm.getAlgorithm(); }
@Override public int hashCode() { return ((version * 37 + signature.hashCode()) * 37 + Arrays.hashCode(issuer.getEncoded())) * 37 + (int)thisUpdate.getTime() / 1000; }
algName = aId.getAlgorithm(); byte[] params = aId.getParameters(); if (params != null && !isNullValue(params)) { try { aParams = AlgorithmParameters.getInstance(algName); aParams.init(aId.getParameters()); if (!mappingExists) { algName = aParams.getAlgorithm();
/** * Returns the PublicKey corresponding to this SubjectPublicKeyInfo * instance. */ public PublicKey getPublicKey() { if (publicKey == null) { final byte[] encoded = getEncoded(); final KeySpec keySpec = new X509EncodedKeySpec(encoded); /* Try using the algorithm name first. */ final String algName = algorithmID.getAlgorithmName(); publicKey = generateKeyForAlgorithm(keySpec, algName); /* * Fall back to using the algorithm OID if it's not the same as the * algorithm name. */ final String algOid = algorithmID.getAlgorithm(); if (publicKey == null && !algOid.equals(algName)) { publicKey = generateKeyForAlgorithm(keySpec, algOid); } /* * Encode this as an X.509 public key since we didn't have any * KeyFactory that could handle this algorithm name or OID. Perhaps * the thing that's using this can decode it. */ if (publicKey == null) { publicKey = new X509PublicKey(algOid, encoded, subjectPublicKey); } } return publicKey; }
public String getDigestEncryptionAlgorithmName() { return digestEncryptionAlgorithm.getAlgorithmName(); }
/** * @see java.security.cert.X509CRL#getSigAlgParams() * method documentation for more info */ public byte[] getSigAlgParams() { if (nullSigAlgParams) { return null; } if (sigAlgParams == null) { sigAlgParams = tbsCertList.getSignature().getParameters(); if (sigAlgParams == null) { nullSigAlgParams = true; return null; } } return sigAlgParams; }
public String getDigestEncryptionAlgorithm() { return digestEncryptionAlgorithm.getAlgorithm(); }
@Override public int hashCode() { return ((version * 37 + signature.hashCode()) * 37 + Arrays.hashCode(issuer.getEncoded())) * 37 + (int)thisUpdate.getTime() / 1000; }
try { threeInts = (ThreeIntegerSequence) ThreeIntegerSequence.ASN1 .decode(ai.getParameters()); } catch (IOException e) { throw new InvalidKeySpecException("Failed to decode parameters: " + e); alg = ai.getAlgorithm(); algName = AlgNameMapper.map2AlgName(alg); setAlgorithm(algName == null ? alg : algName);
public void dumpValue(StringBuilder sb) { sb.append(getAlgorithmName()); if (parameters == null) { sb.append(", no params, "); } else { sb.append(", params unparsed, "); } sb.append("OID = "); sb.append(getAlgorithm()); }
@Override protected void getValues(Object object, Object[] values) { EncryptedPrivateKeyInfo epki = (EncryptedPrivateKeyInfo) object; try { byte[] algParmsEncoded = (epki.algParameters == null) ? nullParam : epki.algParameters.getEncoded(); values[0] = new AlgorithmIdentifier(epki.oid, algParmsEncoded); values[1] = epki.encryptedData; } catch (IOException e) { throw new RuntimeException(e.getMessage()); } } };
public void dumpValue(StringBuilder sb) { sb.append("X.509 CRL v").append(version); sb.append("\nSignature Algorithm: ["); signature.dumpValue(sb); sb.append(']'); sb.append("\nIssuer: ").append(issuer.getName(X500Principal.RFC2253)); sb.append("\n\nThis Update: ").append(thisUpdate); sb.append("\nNext Update: ").append(nextUpdate).append('\n'); if (revokedCertificates != null) { sb.append("\nRevoked Certificates: ").append(revokedCertificates.size()).append(" ["); int number = 1; for (RevokedCertificate revokedCertificate : revokedCertificates) { sb.append("\n [").append(number++).append(']'); revokedCertificate.dumpValue(sb, " "); sb.append('\n'); } sb.append("]\n"); } if (crlExtensions != null) { sb.append("\nCRL Extensions: ").append(crlExtensions.size()).append(" ["); crlExtensions.dumpValue(sb, " "); sb.append("]\n"); } }
public String getDigestEncryptionAlgorithmName() { return digestEncryptionAlgorithm.getAlgorithmName(); }