1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     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*/
21
22package org.apache.harmony.security.tests.support;
23
24import java.security.PrivateKey;
25
26/**
27 * Stub for interface PrivateKey tests
28 */
29
30public class PrivateKeyStub implements PrivateKey {
31
32    private static final long serialVersionUID = 111111111L;
33
34    String algorithm = null;
35    String format = null;
36    byte [] encoded = null;
37
38
39    /**
40     * Constructor
41     *
42     * @param algorithm
43     * @param format
44     * @param encoded
45     */
46    public PrivateKeyStub(String algorithm, String format, byte[] encoded) {
47        this.algorithm = algorithm;
48        this.format = format;
49        this.encoded = encoded;
50    }
51
52    /**
53     * Returns algorithm
54     * @see java.security.Key#getAlgorithm()
55     */
56    public String getAlgorithm() {
57        return algorithm;
58    }
59
60    /**
61     * Returns format
62     * @see java.security.Key#getFormat()
63     */
64    public String getFormat() {
65        return format;
66    }
67
68    /**
69     * Returns encoded form
70     * @see java.security.Key#getEncoded()
71     */
72    public byte[] getEncoded() {
73        return encoded;
74    }
75
76}
77