KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > ejb > ca > sign > ISernoGenerator


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.ejb.ca.sign;
15
16 import java.math.BigInteger JavaDoc;
17
18
19 /**
20  * Interface for a serial number generator.
21  *
22  * @version $Id: ISernoGenerator.java,v 1.1 2006/01/17 20:30:04 anatom Exp $
23  */

24 public interface ISernoGenerator {
25     /**
26      * Generates a number of serial number bytes.
27      *
28      * @return an array of serial number bytes.
29      */

30     public BigInteger JavaDoc getSerno();
31
32     /**
33      * Returns the number of serial number bytes generated by this generator.
34      *
35      * @return The number of serial number bytes generated by this generator.
36      */

37     public int getNoSernoBytes();
38
39     /**
40      * Sets an optional seed needed by the serno generator. This can be different things, for a
41      * sequential generator it can for instance be the first number to be generated and for a
42      * random generator it can be a random seed. The constructor may seed the generator enough so
43      * this method may not be nessecary to call.
44      *
45      * @param the seed used to initilize the serno generator.
46      */

47     public void setSeed(long seed);
48 }
49
Popular Tags