Position: Home page » Computing » The relationship between data force and algorithm

The relationship between data force and algorithm

Publish: 2021-03-29 01:35:19
1. The affiliated hospital is the most advanced hospital in western Guangdong Province
generally, if other hospitals can't manage it, go to the affiliated hospital
2. Data mining: Data Mining generally refers to the process of automatically searching hidden information with special relationship (belonging to association rule learning) from a large number of data. Clustering and classification: about these, I believe that no matter how good the algorithm, there will be a certain degree of accuracy, I did not say that these things are not important.
3. This is unless you create a browser and apply the browser's function code to your software. However, the code may not be 100% compatible and easy to use. You need to make corresponding adjustments
4. I think this function is very practical. It's very convenient to download things. When using Aoyou 3 to visit any page, click the resource sniffer icon to display a list of all videos, audio and pictures on the page. We can check the content we want to download from the list and click "download the selected file" in the lower left corner to download it. I often use it to download videos on the website, It's very easy to use.
5. Data structure is the basis of the algorithm. Data structure focuses on data organization, algorithm focuses on problem solving. For example, arrays and data structures are used to organize data. Sort, query is used to process data.
6. To identify an assembly with a strong name, you must have a pair of public and private keys. This pair of public key and private key encryption keys is used to generate a strongly named assembly (assembler) ring compilation. You can use the strongly named tool (SN. Exe) to create a key pair. Key files usually have a. SNK file extension. Create a key pair and at the command prompt, type the following command: SN – K & lt; file name> In this command, & lt; file name> Is the name of the output file that contains the key pair. The following example is to create a key pair file Sn – K sgkey.snk called sgkey.snk. If you want to delay identifying the assembly and also want to control the whole key pair (unlike the external test scenario, scenario), you can use the command to generate a pair of key pairs, and then extract the public key from the key pair to a separate file. First, create a key pair: SN – K keypair.snk. Then, extract the public key from the key pair file (keypair. SNK) generated above, and it to a separate file: SN – P keypair.snk public.snk. Once you create a key pair, you must place the file where the strong naming and identification tool can find it. When strong naming is used to identify an assembly, the assembly linker (al. Exe) will find the key file related to the current directory and output it to the current directory. When compiling with command-line tools, you can easily this key to the current directory containing the code mole.
7.

In the field of computer programming, the application of data structure and algorithm is everywhere. For example, image and video processing, data compression, database, game development, operating system, compiler, search engine, AR, VR, artificial intelligence, blockchain and other fields are all based on data structure and algorithm

data structure and algorithm belong to the basic internal skill of developers, and can also train the thinking ability of the brain, master once, and benefit for life. A solid foundation of data structure and algorithm can make us think about code from a higher angle, write programs with better performance, learn all kinds of new technologies (such as artificial intelligence, blockchain, etc.) more quickly, and open the door to more advanced programming

data structure and algorithm are frequent customers in the examination questions of famous enterprises. If you don't want to be abandoned by the instry, want to enter a larger famous enterprise, and go further on the it road, it is very necessary to master data structure and algorithm

8. 一:需要包含的包
import java.security.*;
import java.io.*;
import java.util.*;
import java.security.*;
import java.security.cert.*;
import sun.security.x509.*
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;

二:从文件中读取证书
用keytool将.keystore中的证书写入文件中,然后从该文件中读取证书信息
CertificateFactory cf=CertificateFactory.getInstance("X.509");
FileInputStream in=new FileInputStream("out.csr");
Certificate c=cf.generateCertificate(in);

String s=c.toString();
三:从密钥库中直接读取证书
String pass="123456";
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,pass.toCharArray());
java.security.cert.Certificate c=ks.getCertificate(alias);//alias为条目的别名

四:JAVA程序中显示证书指定信息
System.out.println("输出证书信息:\n"+c.toString());
System.out.println("版本号:"+t.getVersion());
System.out.println("序列号:"+t.getSerialNumber().toString(16));
System.out.println("主体名:"+t.getSubjectDN());
System.out.println("签发者:"+t.getIssuerDN());
System.out.println("有效期:"+t.getNotBefore());
System.out.println("签名算法:"+t.getSigAlgName());
byte [] sig=t.getSignature();//签名值
PublicKey pk=t.getPublicKey();
byte [] pkenc=pk.getEncoded();
System.out.println("公钥");
for(int i=0;i<pkenc.length;i++)System.out.print(pkenc[i]+",");

五:JAVA程序列出密钥库所有条目
String pass="123456";
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,pass.toCharArray());
Enumeration e=ks.aliases();
while(e.hasMoreElements())
java.security.cert.Certificate c=ks.getCertificate((String)e.nextElement());

六:JAVA程序修改密钥库口令
String oldpass="123456";
String newpass="654321";
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,oldpass.toCharArray());
in.close();
FileOutputStream output=new FileOutputStream(".keystore");
ks.store(output,newpass.toCharArray());
output.close();

七:JAVA程序修改密钥库条目的口令及添加条目
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,storepass.toCharArray());
Certificate [] cchain=ks.getCertificate(alias);获取别名对应条目的证书链
PrivateKey pk=(PrivateKey)ks.getKey(alias,oldkeypass.toCharArray());获取别名对应条目的私钥
ks.setKeyEntry(alias,pk,newkeypass.toCharArray(),cchain);向密钥库中添加条目
第一个参数指定所添加条目的别名,假如使用已存在别名将覆盖已存在条目,使用新别名将增加一个新条目,第二个参数为条目的私钥,第三个为设置的新口令,第四个为该私钥的公钥的证书链
FileOutputStream output=new FileOutputStream("another");
ks.store(output,storepass.toCharArray())将keystore对象内容写入新文件

八:JAVA程序检验别名和删除条目
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,storepass.toCharArray());
ks.containsAlias("sage");检验条目是否在密钥库中,存在返回true
ks.deleteEntry("sage");删除别名对应的条目
FileOutputStream output=new FileOutputStream(".keystore");
ks.store(output,storepass.toCharArray())将keystore对象内容写入文件,条目删除成功

九:JAVA程序签发数字证书
1从密钥库中读取CA的证书
FileInputStream in=new FileInputStream(".keystore");
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(in,storepass.toCharArray());
java.security.cert.Certificate c1=ks.getCertificate("caroot");
2从密钥库中读取CA的私钥
PrivateKey caprk=(PrivateKey)ks.getKey(alias,cakeypass.toCharArray());
3从CA的证书中提取签发者的信息
byte[] encod1=c1.getEncoded(); 提取CA证书的编码
X509CertImpl cimp1=new X509CertImpl(encod1); 用该编码创建X509CertImpl类型对象
X509CertInfo cinfo1=(X509CertInfo)cimp1.get(X509CertImpl.NAME+"."+X509CertImpl.INFO); 获取X509CertInfo对象
X500Name issuer=(X500Name)cinfo1.get(X509CertInfo.SUBJECT+"."+CertificateIssuerName.DN_NAME); 获取X509Name类型的签发者信息
4获取待签发的证书
CertificateFactory cf=CertificateFactory.getInstance("X.509");
FileInputStream in2=new FileInputStream("user.csr");
java.security.cert.Certificate c2=cf.generateCertificate(in);
5从待签发的证书中提取证书信息
byte [] encod2=c2.getEncoded();
X509CertImpl cimp2=new X509CertImpl(encod2); 用该编码创建X509CertImpl类型对象
X509CertInfo cinfo2=(X509CertInfo)cimp2.get(X509CertImpl.NAME+"."+X509CertImpl.INFO); 获取X509CertInfo对象
6设置新证书有效期
Date begindate=new Date(); 获取当前时间
Date enddate=new Date(begindate.getTime()+3000*24*60*60*1000L); 有效期为3000天
CertificateValidity cv=new CertificateValidity(begindate,enddate); 创建对象
cinfo2.set(X509CertInfo.VALIDITY,cv); 设置有效期
7设置新证书序列号
int sn=(int)(begindate.getTime()/1000); 以当前时间为序列号
CertificateSerialNumber csn=new CertificateSerialNumber(sn);
cinfo2.set(X509CertInfo.SERIAL_NUMBER,csn);
8设置新证书签发者
cinfo2.set(X509CertInfo.ISSUER+"."+CertificateIssuerName.DN_NAME,issuer);应用第三步的结果
9设置新证书签名算法信息
AlgorithmId algorithm=new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);
cinfo2.set(CertificateAlgorithmId.NAME+"."+CertificateAlgorithmId.ALGORITHM,algorithm);
10创建证书并使用CA的私钥对其签名
X509CertImpl newcert=new X509CertImpl(cinfo2);
newcert.sign(caprk,"MD5WithRSA"); 使用CA私钥对其签名
11将新证书写入密钥库
ks.setCertificateEntry("lf_signed",newcert);
FileOutputStream out=new FileOutputStream("newstore");
ks.store(out,"newpass".toCharArray()); 这里是写入了新的密钥库,也可以使用第七条来增加条目

十:数字证书的检验
1验证证书的有效期
a获取X509Certificate类型对象
CertificateFactory cf=CertificateFactory.getInstance("X.509");
FileInputStream in1=new FileInputStream("aa.crt");
java.security.cert.Certificate c1=cf.generateCertificate(in1);
X509Certificate t=(X509Certificate)c1;
in2.close();
b获取日期
Date TimeNow=new Date();
c检验有效性
try{
t.checkValidity(TimeNow);
System.out.println("OK");
}catch(CertificateExpiredException e){ //过期
System.out.println("Expired");
System.out.println(e.getMessage());
}catch(( e){ //尚未生效
System.out.println("Too early");
System.out.println(e.getMessage());}
2验证证书签名的有效性
a获取CA证书
CertificateFactory cf=CertificateFactory.getInstance("X.509");
FileInputStream in2=new FileInputStream("caroot.crt");
java.security.cert.Certificate cac=cf.generateCertificate(in2);
in2.close();
c获取CA的公钥
PublicKey pbk=cac.getPublicKey();
b获取待检验的证书上步已经获取了,就是C1
c检验证书
boolean pass=false;
try{
c1.verify(pbk);
pass=true;
}catch(Exception e){
pass=false;
System.out.println(e);
}
9.

Any program is made up of data and the method of processing the data

just like cooking dishes, both ingredients (data) and cooking methods (processing methods of these ingredients, such as frying, boiling, steaming, baking, stewing, etc.) are essential. The so-called data structure is the method of organizing (a large number of) data, and the so-called algorithm is the method of processing these data

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /. So:

in terms of professional and practical level, Hangzhou juliantec

is a good guide for you to learn Embedded Linux research and development under arm architecture

10. To identify an assembly with a strong name, you must have a pair of public and private keys. This pair of public key and private key encryption keys is used to generate a strongly named assembly (assembler) ring compilation. You can use the strongly named tool (SN. Exe) to create a key pair. Key files usually have a. SNK file extension
● create a key pair
at the command prompt, type the following command:
Sn – K & lt; File name
in this command, & lt; File name is the name of the output file that contains the key pair
the following example is to create a key pair file named sgkey.snk
Sn – K sgkey.snk
if you want to delay identifying the assembly and also want to control the whole key pair (unlike the external test scenario, scenario), you can generate a pair of key pairs with one command, and then extract the public key from the key pair to a separate file
first, create a key pair:
Sn – K keypair. SNK
then, extract the public key from the key pair file (keypair. SNK) generated above, and it to a separate file:
Sn – P keypair. SNK public. SNK
once you create a key pair, you must put the file where the strong naming tool can find it
when strong naming is used to identify an assembly, the assembly linker (al. Exe) will look for key files related to the current directory and output them to the current directory. When compiling with command-line tools, you can easily this key to the current directory containing the code mole.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750