/** * Digests the given data with the mechanism given to the digestInit method. * This method finalizes the current digesting operation; i.e. the * application need (and should) not call digestFinal() after this call. For * digesting multiple pieces of data use digestUpdate and digestFinal. * * @param data * The data to digest. * @return The digested data. * @exception TokenException * If digesting the data failed. * @preconditions (data <> null) * @postconditions (result <> null) */ public int digest(byte[] in, int inOfs, int inLen, byte[] digest, int digestOfs, int digestLen) throws TokenException { digestUpdate(in, inOfs, inLen); return digestFinal(digest, digestOfs, digestLen); }
private byte[] digestKey0(Session session, int digestLen, Mechanism mechanism, SecretKey key) throws TokenException { session.digestInit(mechanism); session.digestKey(key); byte[] digest = new byte[digestLen]; session.digestFinal(digest, 0, digestLen); return digest; }
session.digestKey((SecretKey) signingKey); byte[] digest = new byte[digestLen]; session.digestFinal(digest, 0, digestLen); return digest; } catch (TokenException e) {