本文整理汇总了Java中javax.microedition.io.SecurityInfo类的典型用法代码示例。如果您正苦于以下问题:Java SecurityInfo类的具体用法?Java SecurityInfo怎么用?Java SecurityInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityInfo类属于javax.microedition.io包,在下文中一共展示了SecurityInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
public SecurityInfo getSecurityInfo() throws IOException {
if (securityInfo == null) {
if (cn == null) {
throw new IOException();
}
if (!connected) {
cn.connect();
connected = true;
}
HttpsURLConnection https = (HttpsURLConnection) cn;
Certificate[] certs = https.getServerCertificates();
if (certs.length == 0) {
throw new IOException();
}
securityInfo = new SecurityInfoImpl(
https.getCipherSuite(),
sslContext.getProtocol(),
new CertificateImpl((X509Certificate) certs[0]));
}
return securityInfo;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:24,代码来源:Connection.java
示例2: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
public SecurityInfo getSecurityInfo() throws IOException {
if (securityInfo == null) {
SSLSession session = ((SSLSocket) socket).getSession();
Certificate[] certs = session.getPeerCertificates();
if (certs.length == 0) {
throw new IOException();
}
securityInfo = new SecurityInfoImpl(
session.getCipherSuite(),
session.getProtocol(),
new CertificateImpl((X509Certificate) certs[0]));
}
return securityInfo;
}
开发者ID:freeVM,项目名称:freeVM,代码行数:18,代码来源:Connection.java
示例3: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
/**
* Returns the security information associated with this connection.
*
* @return the security information associated with this open connection
*
* @exception IOException if the connection is closed
*/
public SecurityInfo getSecurityInfo() throws IOException {
if (!copen) {
throw new IOException("Connection closed");
}
return new SSLSecurityInfo(this);
}
开发者ID:tomatsu,项目名称:squawk,代码行数:15,代码来源:SSLStreamConnection.java
示例4: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
@Override
public SecurityInfo getSecurityInfo() throws IOException {
HttpsURLConnection https = (HttpsURLConnection) conn;
if (https.getServerCertificates().length == 0) {
throw new IOException("No certificates");
}
X509Certificate cert = (X509Certificate) https.getServerCertificates()[0];
try {
return new SecurityInfoImpl(SSLContext.getInstance("TLS").getProtocol(), https.getCipherSuite(), cert);
} catch (NoSuchAlgorithmException nsae) {
throw new IOException(nsae);
}
}
开发者ID:SBasalaev,项目名称:alchemy-os,代码行数:14,代码来源:HttpsConnectionImpl.java
示例5: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
@Override
public SecurityInfo getSecurityInfo() throws IOException {
SSLSession session = ((SSLSocket)socket).getSession();
if (session.getPeerCertificates().length == 0) {
throw new IOException("No certificates");
}
X509Certificate cert = (X509Certificate) session.getPeerCertificates()[0];
return new SecurityInfoImpl(session.getProtocol(), session.getCipherSuite(), cert);
}
开发者ID:SBasalaev,项目名称:alchemy-os,代码行数:10,代码来源:SecureConnectionImpl.java
示例6: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
public SecurityInfo getSecurityInfo() throws IOException {
return ssc.getSecurityInfo();
}
开发者ID:tomatsu,项目名称:squawk,代码行数:4,代码来源:Protocol.java
示例7: getSecurityInfo
import javax.microedition.io.SecurityInfo; //导入依赖的package包/类
public SecurityInfo getSecurityInfo() throws IOException {
return streamConnnection.getSecurityInfo();
}
开发者ID:tomatsu,项目名称:squawk,代码行数:5,代码来源:Protocol.java
注:本文中的javax.microedition.io.SecurityInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论