KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > ca > certextensions > DummyAdvancedCertificateExtension


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.model.ca.certextensions;
15
16 import org.bouncycastle.asn1.DEREncodable;
17 import org.bouncycastle.asn1.DERPrintableString;
18 import org.ejbca.core.model.ca.caadmin.CA;
19 import org.ejbca.core.model.ca.certificateprofiles.CertificateProfile;
20 import org.ejbca.core.model.ra.UserDataVO;
21
22 /**
23  * Dummy advanced certificate extension, used for demonstration
24  * and testing of the certificate extension framework.
25  *
26  * Should implement the getValue method.
27  *
28  *
29  * @author Philip Vendil 2007 jan 5
30  *
31  * @version $Id: DummyAdvancedCertificateExtension.java,v 1.1 2007/01/09 16:47:19 herrvendil Exp $
32  */

33
34 public class DummyAdvancedCertificateExtension extends CertificateExtension {
35
36     private static String JavaDoc PROPERTY_VALUE = "value";
37
38     /**
39      * The main method that should return a DEREncodable
40      * using the input data (optional) or defined properties (optional)
41      *
42      * @see org.ejbca.core.model.ca.certextensions.CertificateExtension#getValue(org.ejbca.core.model.ra.UserDataVO, org.ejbca.core.model.ca.caadmin.CA, org.ejbca.core.model.ca.certificateprofiles.CertificateProfile)
43      */

44     public DEREncodable getValue(UserDataVO userData, CA ca,
45             CertificateProfile certProfile) {
46         
47         String JavaDoc value = getProperties().getProperty(PROPERTY_VALUE);
48         
49         return new DERPrintableString(value);
50     }
51
52 }
53
Popular Tags