TAILIEUCHUNG - Java 6 Platform Revealed phần 8

Tham khảo tài liệu 'java 6 platform revealed phần 8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 136 CHAPTER 6 EXTENSIBLE MARKUP LANGUAGE XML C14NMethodParameterSpec null null ref KeyInfoFactory kif KeyValue kv KeyInfo keyInfo kv return signedInfo keyInfo By now the hard part is over. Listing 6-12 shows how to identify where to insert the signature and connect back to the previously used body ID. The last call is what does the signing. Listing 6-12. The Signing Tree private static void signTree Node root PrivateKey privateKey XMLSignature sig throws MarshalException XMLSignatureException Element envelope getFirstChildElement root Element header getFirstChildElement envelope DOMSignContext sigContext new DOMSignContext privateKey header ds getNextSiblingElement header http soap security 2000-12 id sigContext Similar to signing validation see Listing 6-13 isn t that complicated once you have the necessary pieces. Again this requires you to find the signature element before locating the body element to validate. Finally the validate method of XMLSignature is called to see if the tree passes. Listing 6-13. Validating the XML Signature private static boolean validateXMLSignature PublicKey publicKey Node root XMLSignature sig throws XMLSignatureException CHAPTER 6 EXTENSIBLE MARKUP LANGUAGE XML 137 Element envelope getFirstChildElement root Element header getFirstChildElement envelope Element sigElement getFirstChildElement header DOMValidateContext valContext new DOMValidateContext publicKey sigElement getNextSiblingElement header http soap security 2000-12 id return valContext Listing 6-14 shows the complete program in action. A couple .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.