語言

KeyStore.SetKeyEntry 方法

定義

多載

名稱 Description
SetKeyEntry(String, Byte[], Certificate[])

將已受保護的指定金鑰指派給指定的別名。

SetKeyEntry(String, IKey, Char[], Certificate[])

將指定金鑰分配給指定的別名,並以指定密碼保護它。

SetKeyEntry(String, Byte[], Certificate[])

將已受保護的指定金鑰指派給指定的別名。

[Android.Runtime.Register("setKeyEntry", "(Ljava/lang/String;[B[Ljava/security/cert/Certificate;)V", "")]
public void SetKeyEntry(string? alias, byte[]? key, Java.Security.Cert.Certificate[]? chain);
[<Android.Runtime.Register("setKeyEntry", "(Ljava/lang/String;[B[Ljava/security/cert/Certificate;)V", "")>]
member this.SetKeyEntry : string * byte[] * Java.Security.Cert.Certificate[] -> unit

參數

alias
String

別名

key
Byte[]

與別名關聯的金鑰(受保護格式)

chain
Certificate[]

對應公開金鑰的憑證鏈(僅在受保護金鑰型別為 java.security.PrivateKey時才有用)。

屬性

例外狀況

如果未初始key化或KeyStore為空。

key 是 A PrivateKey ,且 chain 則 是 。

aliasnull

備註

將已受保護的指定金鑰指派給指定的別名。

若受保護金鑰型別為 java.security.PrivateKey,必須附有證明對應公鑰的憑證鏈。 若底層的金鑰儲存實作型別為 jkskey 則必須依 EncryptedPrivateKeyInfo PKCS #8 標準定義的 編碼。

如果該別名已經存在,與之相關的金鑰儲存資訊會被該金鑰(可能還有憑證鏈)覆蓋。

Java 文件 java.security.KeyStore.setKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[])

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

SetKeyEntry(String, IKey, Char[], Certificate[])

將指定金鑰分配給指定的別名,並以指定密碼保護它。

[Android.Runtime.Register("setKeyEntry", "(Ljava/lang/String;Ljava/security/Key;[C[Ljava/security/cert/Certificate;)V", "")]
public void SetKeyEntry(string? alias, Java.Security.IKey? key, char[]? password, Java.Security.Cert.Certificate[]? chain);
[<Android.Runtime.Register("setKeyEntry", "(Ljava/lang/String;Ljava/security/Key;[C[Ljava/security/cert/Certificate;)V", "")>]
member this.SetKeyEntry : string * Java.Security.IKey * char[] * Java.Security.Cert.Certificate[] -> unit

參數

alias
String

別名

key
IKey

與別名相關的鑰匙

password
Char[]

保護鑰匙的密碼

chain
Certificate[]

對應公鑰的憑證鏈(僅在指定金鑰型別為 java.security.PrivateKey時才需要)。

屬性

例外狀況

如果這 KeyStore 不是初始化的。

key 是 a PrivateKey ,且 chain 不包含任何憑證。

aliasnull

備註

將指定金鑰分配給指定的別名,並以指定密碼保護它。

若指定金鑰型別為 java.security.PrivateKey,必須附有證明對應公鑰的憑證鏈。

如果該別名已經存在,與之相關的金鑰儲存資訊會被該金鑰(可能還有憑證鏈)覆蓋。

Java 文件 java.security.KeyStore.setKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[])

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於