⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keypair.java

📁 《移动Agent技术》一书的所有章节源代码。
💻 JAVA
字号:
/*
 * @(#)KeyPair.java	1.4 98/07/01
 *
 * Copyright 1995-1998 by Sun Microsystems, Inc.,
 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Sun Microsystems, Inc. ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Sun.
 */

package java.security;

import java.util.*;
import java.io.*;
/**
 * <p>This class is a simple holder for a key pair (a public key and a
 * private key). It does not enforce any security, and, when initialized,
 * should be treated like a PrivateKey.
 *
 * @see PublicKey
 * @see PrivateKey
 *
 * @version 1.4 98/08/19
 * @author Benjamin Renaud
 */
public final class KeyPair {

    private PrivateKey privateKey;
    private PublicKey publicKey;

    /**
     * Constructs a key with the specified public key and private key.
     *
     * @param publicKey the public key.
     *
     * @param privateKey the private key.
     */
    public KeyPair(PublicKey publicKey, PrivateKey privateKey) {
	this.publicKey = publicKey;
	this.privateKey = privateKey;
    }

    /**
     * Returns the public key from this key pair.
     *
     * @return the public key.
     */
    public PublicKey getPublic() {
	return publicKey;
    }

     /**
     * Returns the private key from this key pair.
     *
     * @return the private key.
     */
   public PrivateKey getPrivate() {
	return privateKey;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -