Example usage for org.bouncycastle.crypto.generators Poly1305KeyGenerator checkKey

List of usage examples for org.bouncycastle.crypto.generators Poly1305KeyGenerator checkKey

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.generators Poly1305KeyGenerator checkKey.

Prototype

public static void checkKey(byte[] key) 

Source Link

Document

Checks a 32 byte key for compliance with the Poly1305 key requirements, e.g.

Usage

From source file:freenet.crypt.MessageAuthCode.java

License:GNU General Public License

/**
 * Checks to make sure the provided key is a valid Poly1305 key
 * @param encodedKey Key to check/* w w w.j  a  v a  2  s  .  c  om*/
 */
private final void checkPoly1305Key(byte[] encodedKey) {
    if (type != MACType.Poly1305AES) {
        throw new UnsupportedTypeException(type);
    }
    Poly1305KeyGenerator.checkKey(encodedKey);
}