许可证

Inheritance: java.lang.Object

public class License

提供对组件授权的方法。

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

License license = new License(); license.setLicense(“MyLicense.lic”);

构造函数

构造函数描述
License()初始化此类的新实例。

方法

方法描述
equals(Object arg0)
getClass()
hashCode()
isInternalFIPSSecurity()默认情况下我们使用默认的 JDK 安全。
notify()
notifyAll()
setInternalFIPSSecurity(boolean internalFIPSSecurity)默认情况下我们使用默认的 JRE 安全。
setLicense(InputStream stream)为组件授权。
setLicense(String licenseName)为组件授权。
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

License()

public License()

初始化此类的新实例。

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

License license = new License(); license.setLicense(“MyLicense.lic”);

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

isInternalFIPSSecurity()

public static boolean isInternalFIPSSecurity()

默认情况下我们使用默认的 JDK 安全。默认值 == false。在某些情况下,定制的 java 环境无法支持所需的算法,因此我们建议使用内部内置的 FIPS 安全。

Returns: boolean - 布尔值

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setInternalFIPSSecurity(boolean internalFIPSSecurity)

public static void setInternalFIPSSecurity(boolean internalFIPSSecurity)

默认情况下我们使用默认的 JRE 安全。默认值 == false。在某些情况下,定制的 java 环境无法支持所需的算法,因此我们建议使用内部内置的 FIPS 安全。

另请注意:根据 JVM SecureRandom 算法,在某些操作系统上,/dev/random 在返回结果前会等待主机生成一定量的“噪声”。Oracle 的 JVM 中用于随机数生成的库在 UNIX 平台上默认依赖 /dev/random。虽然 /dev/random 更安全,但如果默认 JVM 配置导致延迟,建议使用 /dev/urandom,或添加生成 /dev/random 熵的设备。

以下 java 选项可帮助避免延迟并覆盖 securerandom.source 设置。-Djava.security.egd=file:/dev/./urandom

Parameters:

参数类型描述
internalFIPSSecuritybooleanboolean 值

setLicense(InputStream stream)

public void setLicense(InputStream stream)

为组件授权。

包含 license 的流。

使用此方法从流中加载 license。

License license = new License(); license.setLicense(myStream);

Parameters:

参数类型描述
java.io.InputStreamlicense 流

setLicense(String licenseName)

public void setLicense(String licenseName)

为组件授权。

尝试在以下位置查找 license:

  1. 明确路径。

  2. 组件 jar 文件的文件夹。

In this example, an attempt will be made to find a license file named MyLicense.lic in the folder that contains the component, in the folder that contains the calling assembly, in the folder of the entry assembly and then in the embedded resources of the calling assembly.

License license = new License(); license.setLicense(“MyLicense.lic”);

Parameters:

参数类型描述
licenseNamejava.lang.String可以是完整或简短的文件名,或嵌入资源的名称。使用空字符串切换到评估模式。

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

参数类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

参数类型描述
arg0long
arg1int