Package org.gnome.webkit
Class Credential
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.webkit.Credential
-
Constructor Summary
ConstructorDescriptionCredential
(MemorySegment address) Create a Credential proxy instance for the provided memory address.Credential
(String username, String password, CredentialPersistence persistence) Create a new credential from the provided username, password and persistence mode. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Make a copy of theWebKitCredential
.static Credential
forCertificate
(@Nullable TlsCertificate certificate, CredentialPersistence persistence) Create a new credential from thecertificate
and persistence mode.static Credential
forCertificatePin
(String pin, CredentialPersistence persistence) Create a new credential from the provided PIN and persistence mode.void
free()
Free theWebKitCredential
.Get the certificate currently held by thisWebKitCredential
.Get the password currently held by thisWebKitCredential
.Get the persistence mode currently held by thisWebKitCredential
.static Type
getType()
Get the GType of the Credential classGet the username currently held by thisWebKitCredential
.boolean
Determine whether this credential has a password stored.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Credential
Create a Credential proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Credential
public Credential(String username, String password, CredentialPersistence persistence) throws UnsupportedPlatformException Create a new credential from the provided username, password and persistence mode.- Parameters:
username
- The username for the new credentialpassword
- The password for the new credentialpersistence
- TheWebKitCredentialPersistence
of the new credential- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
-
Method Details
-
getType
-
forCertificate
public static Credential forCertificate(@Nullable @Nullable TlsCertificate certificate, CredentialPersistence persistence) Create a new credential from thecertificate
and persistence mode.Note that
CredentialPersistence.PERMANENT
is not supported for certificate credentials.- Parameters:
certificate
- TheGTlsCertificate
, ornull
persistence
- TheWebKitCredentialPersistence
of the new credential- Returns:
- A
WebKitCredential
. - Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
forCertificatePin
Create a new credential from the provided PIN and persistence mode.Note that
CredentialPersistence.PERMANENT
is not supported for certificate pin credentials.- Parameters:
pin
- The PIN for the new credentialpersistence
- TheWebKitCredentialPersistence
of the new credential- Returns:
- A
WebKitCredential
. - Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
copy
Make a copy of theWebKitCredential
.- Returns:
- A copy of passed in
WebKitCredential
-
free
public void free()Free theWebKitCredential
. -
getCertificate
Get the certificate currently held by thisWebKitCredential
.- Returns:
- a
GTlsCertificate
, ornull
-
getPassword
Get the password currently held by thisWebKitCredential
.- Returns:
- The password stored in the
WebKitCredential
.
-
getPersistence
Get the persistence mode currently held by thisWebKitCredential
.- Returns:
- The
WebKitCredentialPersistence
stored in theWebKitCredential
.
-
getUsername
Get the username currently held by thisWebKitCredential
.- Returns:
- The username stored in the
WebKitCredential
.
-
hasPassword
public boolean hasPassword()Determine whether this credential has a password stored.- Returns:
true
if the credential has a password orfalse
otherwise.
-