Burak / Kutbay
Menü

Java KeyStore , Keytool Nedir KeyTool Komutları

213 kelime · 2 dk okuma

Bu yazıda

Java KeyStore Nedir? KeyTool Komutları, Sertifika İşlemleri ekleme, oluşturma, primary key oluşturma işlemleri nedir? Self-Signed Sertifika ve KeyStore Üretme, CSR Sertifika Üretme, KeyStore'den Sertifika Silme, İmzalı Primary Sertifikayı KeyStore'a Eklemek, KeyStore Şifresini Değiştirmek, KeyStore Görüntüleme, Private Key Oluşturma Komutları

JSP ile Veritabanı Tablosu Oluşturmak görseli
FIG_001 · javb

Bu yazıda Java Keytool kullanımını açıklayacağım.

Keytool ile Java içerisinde kullanılan ya da kullanılması istenen Keystore içerisindeki sertifikalarının yönetilmesini sağlamaktadır.

Keytool komutu ile yapabilecekler.

  • Self-signed sertifika yükleyebiliriz.
  • Sertifika görüntüleyebiliriz.
  • Sertifika çıkarabiliriz.
  • CSR işlemleri yapılabilir.
  • Private Key oluşturabiliriz.

Self-Signed Sertifika ve KeyStore Üretme

Kod
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 720

CSR Sertifika Üretme

Kod
keytool -certreq -alias mydomain -keystore keystore.jks -storepass password -file mydomain.csr

KeyStore’den Sertifika Silme

Kod
keytool -delete -alias mydomain -keystore keystore.jks -storepass password

İmzalı Primary Sertifikayı KeyStore’a Eklemek

Kod
keytool -import -trustcacerts -alias mydomain -file mycrt.crt -keystore keystore.jks

KeyStore Şifresini Değiştirmek

Kod
keytool -storepasswd -new new_storepass -keystore keystore.jks

KeyStore Görüntüleme

Kod
/JAVA_HOME/jre/bin/keytool -list -keystore KeyStore -storepass password

Private Key Oluşturma

Private key oluşturmak için;

Kod
keytool -genkey -alias KeyToolAlias -keystore privateKey.store

komutu girmek yeterli olacaktır.

Sonrasında bizi gerekli bilgilerimizi girmemiz için bir komut satırı gelecektir.

Kod
Enter keystore password:  123
What is your first and last name?
  [Unknown]:  Ad Soyad
What is the name of your organizational unit?
  [Unknown]:  Yazilimci
What is the name of your organization?
  [Unknown]:  example.com
What is the name of your City or Locality?
  [Unknown]:  TR
What is the name of your State or Province?
  [Unknown]:  TR
What is the two-letter country code for this unit?
  [Unknown]:  TR
Is CN=Ad Soyad, OU=Yaizilimci, O=example.com, L=TR, ST=TR, C=TR correct?
  [no]:  yes

Etiketler · 3

Faydalı olduysa paylaş

Yorum yaz

E-posta adresin yayımlanmaz. Zorunlu alanlar * ile işaretli.