亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? testsignature.java

?? 冒險島游戲的flash版本的函數
?? JAVA
字號:
import java.util.*;import net.jxta.document.*;import jxta.security.util.URLBase64;import jxta.security.signature.Signature;import jxta.security.crypto.JxtaCrypto;import jxta.security.publickey.PublicKeyAlgorithm;import jxta.security.impl.publickey.RSAPublickeyData;import jxta.security.impl.publickey.RSAPrivatekeyData;import jxta.security.impl.publickey.RSAKey;import jxta.security.impl.cipher.KeyBuilder;import jxta.security.impl.crypto.JxtaCryptoSuite;public class TestSignature {    static RSAPublickeyData publicKeyData;    static RSAPrivatekeyData privateKeyData;    // Get the data to sign into the buffer. The data must always appear in    // the same order, which is why we can抰 just enumerate through all the    // elements in the document; we must look them up in a specific order.    // Returns the length of the data to sign    public static int getDataToSign(StructuredDocument doc, byte[] buf) throws Exception {        int length = 0;        Enumeration enum = doc.getChildren("Price");        while (enum.hasMoreElements()) {            Element element = (Element) enum.nextElement();            String value = (String) element.getValue();            byte[] temp = value.getBytes();            System.arraycopy(temp, 0, buf, length, temp.length);            length += temp.length;        }        enum = doc.getChildren("Brand");        while (enum.hasMoreElements()) {            Element element = (Element) enum.nextElement();            String value = (String) element.getValue();            byte[] temp = value.getBytes();            System.arraycopy(temp, 0, buf, length, temp.length);            length += temp.length;        }        return length;    }    public static boolean validateMessage(StructuredDocument doc) throws Exception {        // Step 1: Generate and initialize the necessary RSA key        RSAKey rsaKey = (RSAKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA,                                                KeyBuilder.LENGTH_RSA_512,                                                false);        // Step 2: Create a profile that can do signing        JxtaCrypto jc = new JxtaCryptoSuite(JxtaCrypto.PROFILE_RSA_SHA1,                                            rsaKey,                                            Signature.ALG_RSA_SHA_PKCS1,                                            (byte) 0);        // Step 3: Initialize the key based on the saved data (e.g.,        // you'd normally read this data from persistent store        // Since we're validating the signature, use the public key        PublicKeyAlgorithm pka = jc.getJxtaPublicKeyAlgorithm();        pka.setPublicKey(publicKeyData);        // Step 4: Get the data from the document. In this case, we also        // need the signature data        byte[] data = new byte[1024];        int length = getDataToSign(doc, data);        Enumeration enum = doc.getChildren("Signature");        byte[] signature = null;        while (enum.hasMoreElements()) {            Element element = (Element) enum.nextElement();            String value = (String) element.getValue();            byte[] enc = value.getBytes();            signature = URLBase64.decode(enc, 0, enc.length);        }        // Step 5: Get the signature object, initialize it, and verify        Signature s = jc.getJxtaSignature();        s.init(Signature.MODE_VERIFY);        boolean verified = s.verify(data, 0, length, signature, 0, signature.length);        return verified;    }    public static void signMessage(StructuredDocument doc) throws Exception {        // Step 1: Generate and initialize the necessary RSA key        RSAKey rsaKey = (RSAKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA,                                                KeyBuilder.LENGTH_RSA_512,                                                false);        // Step 2: Create a profile that can do signing        JxtaCrypto jc = new JxtaCryptoSuite(JxtaCrypto.PROFILE_RSA_SHA1,                                            rsaKey,                                            Signature.ALG_RSA_SHA_PKCS1,                                            (byte) 0);        // Step 3: Initialize the key based on the saved data (e.g.,        // you'd normally read this data from persistent store        PublicKeyAlgorithm pka = jc.getJxtaPublicKeyAlgorithm();        pka.setPublicKey(publicKeyData);        pka.setPrivateKey(privateKeyData);        // Step 4: Get the signature object, initialize it, and sign the data        Signature s = jc.getJxtaSignature();        s.init(Signature.MODE_SIGN);        byte[] data = new byte[1024];        int length = getDataToSign(doc, data);        byte[] signature = s.sign(data, 0, length);        // Step 5: Add the signature to the document        Element el = doc.createElement("Signature",                         new String(URLBase64.encode(signature)));        doc.appendChild(el);    }    public static void main(String[] args) throws Exception {        // Step 1: Generate and initialize the necessary RSA key        RSAKey rsaKey = (RSAKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA,                                                KeyBuilder.LENGTH_RSA_512,                                                false);        // Step 2: Create a profile that can do signing        JxtaCrypto jc = new JxtaCryptoSuite(JxtaCrypto.PROFILE_RSA_SHA1,                                            rsaKey,                                            Signature.ALG_RSA_SHA_PKCS1, (byte) 0);        // Step 3: Complete the initialization of the keys        PublicKeyAlgorithm pka = jc.getJxtaPublicKeyAlgorithm();        pka.setPublicKey();        pka.setPrivateKey();        // Step 4: Save the public/private key data. Normally, these would        // go into persistent storage, and the HungyPeer would be sent        // the public key        publicKeyData = (RSAPublickeyData) pka.getPublickey();        privateKeyData = (RSAPrivatekeyData) pka.getPrivatekey();        // Step 5: Create the document, just as we did in the RestoPeer        StructuredDocument bid =            StructuredDocumentFactory.newStructuredDocument(                        new MimeMediaType("text", "xml"),                        "RestoNet:Bid");        Element el = bid.createElement("Brand", "Chez JXTA");        bid.appendChild(el);        el = bid.createElement("Price", "$1.00");        bid.appendChild(el);        // Step 6: Sign the document        signMessage(bid);        // Step 7: Validate the document        // We'd normally transmit the document and the recipient        // would validate its signature. We'll just do that in place        boolean valid = validateMessage(bid);        System.out.println("Signature was " + ((valid) ? "ok" : "invalid"));    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av中文一区二区三区| 风间由美中文字幕在线看视频国产欧美| 日本欧洲一区二区| 国产99久久久国产精品潘金| 91福利国产成人精品照片| 精品免费视频.| 亚洲国产精品麻豆| 成人少妇影院yyyy| 精品国产免费一区二区三区四区 | 国产在线观看免费一区| 91女人视频在线观看| 久久久久久久久久久久电影| 日韩制服丝袜先锋影音| av一区二区久久| 国产三级一区二区| 精品在线免费观看| 日韩欧美aaaaaa| 五月婷婷激情综合| 欧美手机在线视频| 一区二区在线观看不卡| 91在线你懂得| 成人欧美一区二区三区白人| 成人h精品动漫一区二区三区| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲精品成a人| bt欧美亚洲午夜电影天堂| 久久综合五月天婷婷伊人| 日本女优在线视频一区二区| 欧美日韩一区二区三区在线看| 中文字幕一区二区不卡| 国产91精品在线观看| 久久久久亚洲蜜桃| 亚洲六月丁香色婷婷综合久久| 韩国av一区二区三区| 欧美一区二区三区小说| 一区二区日韩av| 成人网页在线观看| 精品国产一区二区亚洲人成毛片| 图片区小说区国产精品视频| 色综合久久中文综合久久97| 国产欧美精品国产国产专区| 激情六月婷婷久久| 欧美xxxxx裸体时装秀| 日韩精品免费视频人成| 欧美日韩专区在线| 亚洲一级片在线观看| 91玉足脚交白嫩脚丫在线播放| 国产女人aaa级久久久级| 国模冰冰炮一区二区| 精品国产髙清在线看国产毛片| 免费高清在线一区| 亚洲精品在线一区二区| 日韩电影在线一区| 337p日本欧洲亚洲大胆精品| 精品在线免费观看| 国产欧美一区二区三区鸳鸯浴| 韩国精品主播一区二区在线观看| 久久蜜桃香蕉精品一区二区三区| 香蕉av福利精品导航| 欧美日韩一卡二卡| 欧美aaaaaa午夜精品| 久久亚洲精华国产精华液| 国产一区二区三区视频在线播放| 久久综合久久综合久久综合| 国产一区二区不卡在线 | 日韩亚洲欧美综合| 乱一区二区av| 国产精品视频在线看| 成人国产免费视频| 亚洲免费在线视频一区 二区| 91美女精品福利| 日本欧美一区二区在线观看| 久久综合99re88久久爱| 成人性生交大片免费看在线播放| 26uuu国产在线精品一区二区| 国产精品白丝jk黑袜喷水| 国产精品久久久久影院亚瑟| 在线观看一区日韩| 日韩电影免费在线看| 国产亚洲精品超碰| 欧美三级韩国三级日本一级| 久久69国产一区二区蜜臀| 亚洲国产精品精华液ab| 欧美日韩免费不卡视频一区二区三区| 毛片一区二区三区| 亚洲视频一区在线| 日韩一区二区三区在线观看| 国产一区福利在线| 2023国产精华国产精品| 99在线精品视频| 日韩黄色免费网站| 国产片一区二区三区| 欧美精品在欧美一区二区少妇| 国产精品一区二区免费不卡| 亚洲蜜臀av乱码久久精品蜜桃| 日韩视频123| 色94色欧美sute亚洲线路二| 精品制服美女久久| 亚洲欧美激情小说另类| 日韩欧美成人激情| www.色综合.com| 国产综合色在线| 亚洲电影欧美电影有声小说| 久久精品欧美一区二区三区麻豆| 欧美三片在线视频观看| 丰满放荡岳乱妇91ww| 蜜桃久久久久久| 亚洲一区二区不卡免费| 最新欧美精品一区二区三区| 777亚洲妇女| 欧美偷拍一区二区| 国产一区视频导航| 免费观看在线综合色| 一区二区日韩av| 国产精品毛片高清在线完整版| 精品国产网站在线观看| 91精品中文字幕一区二区三区 | 日韩精品91亚洲二区在线观看| 成人免费一区二区三区在线观看| 久久亚洲影视婷婷| 日韩精品一区二区三区中文不卡| 欧美日韩中文字幕一区二区| 成人av资源在线观看| 国产·精品毛片| 日本三级亚洲精品| 日韩二区在线观看| 日本亚洲电影天堂| 视频一区视频二区在线观看| 亚洲二区在线观看| 亚洲综合免费观看高清完整版| 中文字幕欧美国产| 国产欧美一区二区三区在线老狼| 精品粉嫩aⅴ一区二区三区四区| 91麻豆精品久久久久蜜臀| 欧美精品乱人伦久久久久久| 欧美在线看片a免费观看| 欧美三级电影在线观看| 欧美日韩极品在线观看一区| 欧美日韩电影一区| 日韩三级电影网址| 欧美电影精品一区二区 | 国产iv一区二区三区| 狠狠色狠狠色综合系列| 不卡大黄网站免费看| av一区二区三区黑人| 日本精品一区二区三区四区的功能| 91丨porny丨最新| 色丁香久综合在线久综合在线观看| 在线日韩av片| 7777精品伊人久久久大香线蕉超级流畅 | 国产精品污污网站在线观看| 国产精品午夜在线观看| 亚洲色图视频网| 调教+趴+乳夹+国产+精品| 欧美aaaaaa午夜精品| 国产精品影音先锋| 91影院在线免费观看| 精品美女一区二区三区| 中文字幕成人在线观看| 一区二区三区久久| 日av在线不卡| gogogo免费视频观看亚洲一| 欧美久久一二三四区| 国产视频一区不卡| 亚洲一区在线电影| 性做久久久久久久免费看| 肉肉av福利一精品导航| 免费成人你懂的| 大尺度一区二区| 99久久精品国产麻豆演员表| 欧美日韩在线播| 国产亚洲精品久| 亚洲成年人影院| 粉嫩久久99精品久久久久久夜 | 成人视屏免费看| 91精品国产综合久久香蕉麻豆 | 免费在线观看成人| 国产精品白丝jk黑袜喷水| 日韩一二三区视频| 亚洲三级在线免费| 国产精品中文字幕日韩精品| 欧美亚洲综合久久| 欧美国产成人精品| 美女视频黄免费的久久 | 狠狠狠色丁香婷婷综合久久五月| 99re这里只有精品6| 欧美成人激情免费网| 亚洲精品精品亚洲| 国产成人精品午夜视频免费 | 久久你懂得1024| 亚洲成人av在线电影| 99久免费精品视频在线观看| 欧美日韩一区二区三区四区| 一区二区三区欧美日| 99精品欧美一区二区蜜桃免费 | 国产欧美日本一区二区三区| 久久99这里只有精品| 欧美制服丝袜第一页| 亚洲欧美区自拍先锋| www.爱久久.com|