All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yubico.u2f.crypto.RandomChallengeGenerator Maven / Gradle / Ivy

There is a newer version: 0.19.12
Show newest version
/*
 * Copyright 2014 Yubico.
 * Copyright 2014 Google Inc. All rights reserved.
 *
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file or at
 * https://developers.google.com/open-source/licenses/bsd
 */

package com.yubico.u2f.crypto;

import java.security.SecureRandom;

public class RandomChallengeGenerator implements ChallengeGenerator {

    private final SecureRandom random = new SecureRandom();

    @Override
    public byte[] generateChallenge() {
        byte[] randomBytes = new byte[32];
        random.nextBytes(randomBytes);
        return randomBytes;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy