Source Code Cross Referenced for AlgorithmParametersSpi.java in  » 6.0-JDK-Core » security » java » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » java.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.security;
027
028        import java.io.*;
029        import java.security.spec.AlgorithmParameterSpec;
030        import java.security.spec.InvalidParameterSpecException;
031
032        /**
033         * This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
034         * for the <code>AlgorithmParameters</code> class, which is used to manage
035         * algorithm parameters.
036         *
037         * <p> All the abstract methods in this class must be implemented by each 
038         * cryptographic service provider who wishes to supply parameter management
039         * for a particular algorithm.
040         *
041         * @author Jan Luehe
042         *
043         * @version 1.20, 05/05/07
044         *
045         * @see AlgorithmParameters
046         * @see java.security.spec.AlgorithmParameterSpec
047         * @see java.security.spec.DSAParameterSpec
048         *
049         * @since 1.2
050         */
051
052        public abstract class AlgorithmParametersSpi {
053
054            /**
055             * Initializes this parameters object using the parameters 
056             * specified in <code>paramSpec</code>.
057             *
058             * @param paramSpec the parameter specification.
059             *
060             * @exception InvalidParameterSpecException if the given parameter
061             * specification is inappropriate for the initialization of this parameter
062             * object.
063             */
064            protected abstract void engineInit(AlgorithmParameterSpec paramSpec)
065                    throws InvalidParameterSpecException;
066
067            /**
068             * Imports the specified parameters and decodes them
069             * according to the primary decoding format for parameters.
070             * The primary decoding format for parameters is ASN.1, if an ASN.1
071             * specification for this type of parameters exists.
072             *
073             * @param params the encoded parameters.
074             *
075             * @exception IOException on decoding errors
076             */
077            protected abstract void engineInit(byte[] params)
078                    throws IOException;
079
080            /**
081             * Imports the parameters from <code>params</code> and
082             * decodes them according to the specified decoding format.
083             * If <code>format</code> is null, the
084             * primary decoding format for parameters is used. The primary decoding
085             * format is ASN.1, if an ASN.1 specification for these parameters
086             * exists.
087             *
088             * @param params the encoded parameters.
089             *
090             * @param format the name of the decoding format.
091             *
092             * @exception IOException on decoding errors
093             */
094            protected abstract void engineInit(byte[] params, String format)
095                    throws IOException;
096
097            /**
098             * Returns a (transparent) specification of this parameters
099             * object.
100             * <code>paramSpec</code> identifies the specification class in which 
101             * the parameters should be returned. It could, for example, be
102             * <code>DSAParameterSpec.class</code>, to indicate that the
103             * parameters should be returned in an instance of the 
104             * <code>DSAParameterSpec</code> class.
105             *
106             * @param paramSpec the the specification class in which 
107             * the parameters should be returned.
108             *
109             * @return the parameter specification.
110             *
111             * @exception InvalidParameterSpecException if the requested parameter
112             * specification is inappropriate for this parameter object.
113             */
114            protected abstract <T extends AlgorithmParameterSpec> T engineGetParameterSpec(
115                    Class<T> paramSpec) throws InvalidParameterSpecException;
116
117            /**
118             * Returns the parameters in their primary encoding format.
119             * The primary encoding format for parameters is ASN.1, if an ASN.1
120             * specification for this type of parameters exists.
121             *
122             * @return the parameters encoded using their primary encoding format.
123             *
124             * @exception IOException on encoding errors.
125             */
126            protected abstract byte[] engineGetEncoded() throws IOException;
127
128            /**
129             * Returns the parameters encoded in the specified format.
130             * If <code>format</code> is null, the
131             * primary encoding format for parameters is used. The primary encoding
132             * format is ASN.1, if an ASN.1 specification for these parameters
133             * exists.
134             *
135             * @param format the name of the encoding format.
136             *
137             * @return the parameters encoded using the specified encoding scheme.
138             *
139             * @exception IOException on encoding errors.
140             */
141            protected abstract byte[] engineGetEncoded(String format)
142                    throws IOException;
143
144            /**
145             * Returns a formatted string describing the parameters.
146             *
147             * @return a formatted string describing the parameters.
148             */
149            protected abstract String engineToString();
150        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.