01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Aleksei Y. Semenov
20: * @version $Revision$
21: */package org.apache.harmony.security.tests.support;
22:
23: import java.security.PrivateKey;
24:
25: /**
26: * Stub for interface PrivateKey tests
27: */
28:
29: public class PrivateKeyStub implements PrivateKey {
30:
31: private static final long serialVersionUID = 111111111L;
32:
33: String algorithm = null;
34: String format = null;
35: byte[] encoded = null;
36:
37: /**
38: * Constructor
39: *
40: * @param algorithm
41: * @param format
42: * @param encoded
43: */
44: public PrivateKeyStub(String algorithm, String format,
45: byte[] encoded) {
46: this .algorithm = algorithm;
47: this .format = format;
48: this .encoded = encoded;
49: }
50:
51: /**
52: * Returns algorithm
53: * @see java.security.Key#getAlgorithm()
54: */
55: public String getAlgorithm() {
56: return algorithm;
57: }
58:
59: /**
60: * Returns format
61: * @see java.security.Key#getFormat()
62: */
63: public String getFormat() {
64: return format;
65: }
66:
67: /**
68: * Returns encoded form
69: * @see java.security.Key#getEncoded()
70: */
71: public byte[] getEncoded() {
72: return encoded;
73: }
74:
75: }
|