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

📄 utilisateur.java

📁 基于java的完整的RSA算法实现 /** * <p>Titre : RSA </p> * <p>Description : Encodage de donn閑s
💻 JAVA
字号:
package rsa;

import java.io.*;
import java.math.*;
import java.util.*;

public class Utilisateur
    extends Personne
    implements Serializable
{
  protected RSA cleRSA;
  protected Hashtable contacts;

  public Utilisateur(String nom, RSA cleRSA)
  {
    super(nom, cleRSA.getModulus(), cleRSA.getPublicKey());
    super.nom = nom;
    this.cleRSA = cleRSA;
    contacts = new Hashtable();
  }

  private void readObject(ObjectInputStream ois) throws ClassNotFoundException,
      IOException
  {
    ois.defaultReadObject();
  }

  private void writeObject(ObjectOutputStream oos) throws IOException
  {
    oos.defaultWriteObject();
  }

  public void addContact(Object key, Object values)
  {
    contacts.put(key, values);
  }

  public Object removeContact(Object key)
  {
    return contacts.remove(key);
  }

  public Object getContact(Object key)
  {
    return contacts.get(key);
  }

  public RSA getCleRSA()
  {
    return cleRSA;
  }

  public Hashtable getContacts()
  {
    return contacts;
  }

  /**
   *
   * @deprecated
   * @param modulos BigInteger
   */
  public void setModulos(BigInteger modulos)
  {
    super.modulos = modulos;
  }

  /**
   *
   * @deprecated
   * @param clePublic BigInteger
   */
  public void setClePublic(BigInteger clePublic)
  {
    super.clePublic = clePublic;
  }

  public void setContacts(Hashtable contacts)
  {
    this.contacts = contacts;
  }

  public void decryptCle(byte[] password)
  {
    this.cleRSA.xOrClePrive(new BigInteger(password));
  }
}

⌨️ 快捷键说明

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