public class CodeSource extends Object implements Serializable
这类扩展代码的概念封装不仅位置(URL)而且证书链,用来验证签名的代码从该位置。
Constructor and Description |
---|
CodeSource(URL url, Certificate[] certs)
构建CodeSource,并将其与指定的位置并设置证书。
|
CodeSource(URL url, CodeSigner[] signers)
构建CodeSource,并将其与指定的位置并设置代码签名。
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
指定对象和该对象之间的相等性的测试。
|
Certificate[] |
getCertificates()
返回与此相关的证书CodeSource。
|
CodeSigner[] |
getCodeSigners()
返回与此相关的代码签名CodeSource。
|
URL |
getLocation()
返回与此相关的位置CodeSource。
|
int |
hashCode()
返回此对象的哈希代码值。
|
boolean |
implies(CodeSource codesource)
返回true如果CodeSource对象”意味着“指定CodeSource。
|
String |
toString()
返回一个描述这个CodeSource字符串,告诉它的URL和证书。
|
public CodeSource(URL url, Certificate[] certs)
url
-位置(URL)。
certs
-证书(S)。它可能是空的。数组的内容被复制以防止后续的修改。
public CodeSource(URL url, CodeSigner[] signers)
url
-位置(URL)。
signers
-代码签名。它可能是空的。数组的内容被复制以防止后续的修改。
public int hashCode()
hashCode
方法重写,继承类
Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object obj)
equals
方法重写,继承类
Object
obj
-与此对象相等测试对象。
Object.hashCode()
,
HashMap
public final URL getLocation()
public final Certificate[] getCertificates()
如果这个对象是使用CodeSource(URL url, CodeSigner[] signers)
CodeSource然后构造函数证书链的提取和用于创建对象数组创建证书。每个签名证书的后面是它的支持证书链(可能是空的)。每个签名证书和它的支持证书链是有序的底部到顶部(即,与签名者证书的第一和(根)证书管理局最后一次)。
public final CodeSigner[] getCodeSigners()
如果这个对象是使用CodeSource(URL url, java.security.cert.Certificate[] certs)
CodeSource然后构造函数证书链的提取和用于创建对象数组创建codesigner。注意只有X.509证书进行检查,所有其他的证书类型被忽略。
public boolean implies(CodeSource codesource)
更具体地说,这种方法使以下检查。如果任何失败,它返回错误。如果他们都成功了,它返回真。
例如,CodeSource对象以下位置和空证书都意味着与位置”http://java.sun.com/classes/foo.jar”和无效证书CodeSource:
HTTP:HTTP:/ / *。太阳。COM /类/ *http://java.sun.com/classes/—http://java.sun.com/classes/foo.jar注意,如果这一个空位置和CodeSource无效证书链,那意味着所有其他CodeSource。
codesource
- CodeSource比较。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.