模块 java.base

接口 PrivateKey

所有父级接口:
Destroyable , Key , Serializable
所有已知的子接口:
DHPrivateKey , DSAPrivateKey , ECPrivateKey , EdECPrivateKey , RSAMultiPrimePrivateCrtKey , RSAPrivateCrtKey , RSAPrivateKey , XECPrivateKey

public interface PrivateKey extends Key , Destroyable
私钥。此接口的目的是对所有私钥接口进行分组(并为其提供类型安全)。

注意:专用私钥接口扩展了此接口。例如,参见 java.security.interfaces 中的 DSAPrivateKey 接口。

实现应覆盖 Destroyable 接口中的默认 destroyisDestroyed 方法,以便销毁、清除敏感密钥信息,或者在此类信息不可变、未引用的情况下。最后,由于 PrivateKeySerializable ,实现还应该覆盖 ObjectOutputStream.writeObject(java.lang.Object) 以防止已被销毁的密钥被序列化。

自从:
1.1
参见:
  • 字段详细信息

    • serialVersionUID

      @Deprecated static final long serialVersionUID
      已弃用。
      接口中的 serialVersionUID 字段无效。不使用;没有替代品。
      设置为指示与该类的先前版本的序列化兼容性的类指纹。
      参见: