
- หมวดหมู่ที่เป็นที่นิยม
โครงสร้างข้อมูล
การจัดการเครือข่าย
RDBMS
ระบบปฏิบัติการ
Java
MS Excel
iOS
HTML
CSS
Android
Python
การเขียนโปรแกรม C
C++
C#
MongoDB
MySQL
Javascript
PHP
ฟิสิกส์
เคมี
ชีววิทยา
คณิตศาสตร์
ภาษาอังกฤษ
เศรษฐศาสตร์
จิตวิทยา
สังคมศึกษา
การศึกษาแฟชั่น
การศึกษากฎหมาย
- การเลือกอ่าน
- บันทึกเกี่ยวกับข้อสอบ UPSC IAS
- แนวทางปฏิบัติที่ดีที่สุดของนักพัฒนา
- คำถามและคำตอบ
- การเขียนประวัติย่อที่ได้ผล
- คำถามสัมภาษณ์สำหรับฝ่ายทรัพยากรบุคคล
- คำศัพท์คอมพิวเตอร์
- ใครเป็นใคร
Java Signature getAlgorithm() 方法 พร้อมตัวอย่าง
ชื่อของอัลกอริทึมสำหรับวัตถุลายเซ็นสามารถรับได้โดยใช้เมธอด getAlgorithm() ในคลาส java.security.Signature
เรามาดูตัวอย่างกันดีกว่า −
ตัวอย่าง
import java.security.*; import java.util.*; public class Main { public static void main(String[] argv) { try { Signature signature = Signature.getInstance("SHA256withRSA"); String algorithm = signature.getAlgorithm(); System.out.println("The Algorithm = " + algorithm); } catch (NoSuchAlgorithmException e) { System.out.println("Error!! NoSuchAlgorithmException"); } } }
เอาต์พุต
The Algorithm = SHA256withRSA
เรามาดูตัวอย่างอื่นดีกว่า −
Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.
ตัวอย่าง
import java.security.*; import java.util.*; public class Main { public static void main(String[] argv) { try { Signature signature = Signature.getInstance("SHA1withDSA"); String algorithm = signature.getAlgorithm(); System.out.println("The Algorithm = " + algorithm); } catch (NoSuchAlgorithmException e) { System.out.println("Error!! NoSuchAlgorithmException"); } } }
เอาต์พุต
The Algorithm = SHA1withDSA
广告