private byte[] derEncode( byte[] hash) throws IOException { DigestInfo dInfo = new DigestInfo(algId, hash); return dInfo.getEncoded(ASN1Encoding.DER); } }
public AlgorithmIdentifier getAlgorithmHash() { if (otherCertHash.toASN1Primitive() instanceof ASN1OctetString) { // SHA-1 return new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1); } else { return DigestInfo.getInstance(otherCertHash).getAlgorithmId(); } }
public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof MessageImprint) { return messageImprint.equals(((MessageImprint)o).messageImprint); } return false; }
public OtherCertID( AlgorithmIdentifier algId, byte[] digest, IssuerSerial issuerSerial) { this.otherCertHash = new DigestInfo(algId, digest); this.issuerSerial = issuerSerial; }
byte[] res = calculatePbeMac(mData.getMac().getAlgorithmId().getAlgorithm(), mData.getSalt(), itCount, passwd, data, provider); AlgorithmIdentifier algId = new AlgorithmIdentifier(mData.getMac().getAlgorithmId().getAlgorithm(), DERNull.INSTANCE); DigestInfo dInfo = new DigestInfo(algId, res);
AlgorithmIdentifier algId = dInfo.getAlgorithmId(); byte[] salt = mData.getSalt(); int itCount = mData.getIterationCount().intValue(); byte[] dig = dInfo.getDigest();
final DigestInfo otherHashAlgAndValue = new DigestInfo(hashid, hashed); v.add(otherHashAlgAndValue.toASN1Primitive()); // como sequence
/** * Return the algorithm identifier describing the MAC algorithm * * @return the AlgorithmIdentifier representing the MAC algorithm, null if none present. */ public AlgorithmIdentifier getMacAlgorithmID() { MacData md = pfx.getMacData(); if (md != null) { return md.getMac().getAlgorithmId(); } return null; }
DigestInfo digestInfo = new DigestInfo(new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha512), hash); byte[] digestedHash = digestInfo.getEncoded(ASN1Encoding.DER);
public byte[] getCertHash() { if (otherCertHash.toASN1Primitive() instanceof ASN1OctetString) { // SHA-1 return ((ASN1OctetString)otherCertHash.toASN1Primitive()).getOctets(); } else { return DigestInfo.getInstance(otherCertHash).getDigest(); } }
public static DigestInfo getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
public int hashCode() { return messageImprint.hashCode(); } }
public OtherCertID( AlgorithmIdentifier algId, byte[] digest, IssuerSerial issuerSerial) { this.otherCertHash = new DigestInfo(algId, digest); this.issuerSerial = issuerSerial; }
byte[] res = calculatePbeMac(mData.getMac().getAlgorithmId().getObjectId(), mData.getSalt(), itCount, passwd, data, provider); AlgorithmIdentifier algId = new AlgorithmIdentifier(mData.getMac().getAlgorithmId().getObjectId(), new DERNull()); DigestInfo dInfo = new DigestInfo(algId, res);
macAlgorithm = dInfo.getAlgorithmId(); byte[] salt = mData.getSalt(); itCount = validateIterationCount(mData.getIterationCount()); byte[] dig = dInfo.getDigest();
/** * Return the algorithm identifier describing the MAC algorithm * * @return the AlgorithmIdentifier representing the MAC algorithm, null if none present. */ public AlgorithmIdentifier getMacAlgorithmID() { MacData md = pfx.getMacData(); if (md != null) { return md.getMac().getAlgorithmId(); } return null; }
byte[] hashToEncrypt = digestInfo.getEncoded();
public byte[] getCertHash() { if (otherCertHash.toASN1Primitive() instanceof ASN1OctetString) { // SHA-1 return ((ASN1OctetString)otherCertHash.toASN1Primitive()).getOctets(); } else { return DigestInfo.getInstance(otherCertHash).getDigest(); } }
public static DigestInfo getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
public int hashCode() { return messageImprint.hashCode(); } }