public static PKMACValue getInstance(Object o) { if (o instanceof PKMACValue) { return (PKMACValue)o; } if (o != null) { return new PKMACValue(ASN1Sequence.getInstance(o)); } return null; }
public static PKMACValue getInstance(Object o) { if (o instanceof PKMACValue) { return (PKMACValue)o; } if (o != null) { return new PKMACValue(ASN1Sequence.getInstance(o)); } return null; }
public PKMACValue generate(char[] password, SubjectPublicKeyInfo keyInfo) throws CRMFException { MacCalculator calculator = builder.build(password); OutputStream macOut = calculator.getOutputStream(); try { macOut.write(keyInfo.getEncoded(ASN1Encoding.DER)); macOut.close(); } catch (IOException e) { throw new CRMFException("exception encoding mac input: " + e.getMessage(), e); } return new PKMACValue(calculator.getAlgorithmIdentifier(), new DERBitString(calculator.getMac())); } }
public PKMACValue generate(char[] password, SubjectPublicKeyInfo keyInfo) throws CRMFException { MacCalculator calculator = builder.build(password); OutputStream macOut = calculator.getOutputStream(); try { macOut.write(keyInfo.getEncoded(ASN1Encoding.DER)); macOut.close(); } catch (IOException e) { throw new CRMFException("exception encoding mac input: " + e.getMessage(), e); } return new PKMACValue(calculator.getAlgorithmIdentifier(), new DERBitString(calculator.getMac())); } }