KeyStore.SecretKeyEntry (Java SE 9 & JDK 9 )
- java.lang.Object
-
- java.security.KeyStore.SecretKeyEntry
-
- All Implemented Interfaces:
KeyStore.Entry
- Enclosing class:
- KeyStore
public static final class KeyStore.SecretKeyEntry extends Object implements KeyStore.Entry
A
KeyStoreentry that holds aSecretKey.- Since:
- 1.5
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.security.KeyStore.Entry
KeyStore.Entry.Attribute
-
-
Constructor Summary
Constructors Constructor Description SecretKeyEntry(SecretKey secretKey)Constructs a
SecretKeyEntrywith aSecretKey.SecretKeyEntry(SecretKey secretKey, Set<KeyStore.Entry.Attribute> attributes)Constructs a
SecretKeyEntrywith aSecretKeyand associated entry attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<KeyStore.Entry.Attribute>getAttributes()Retrieves the attributes associated with an entry.
SecretKeygetSecretKey()Gets the
SecretKeyfrom this entry.StringtoString()Returns a string representation of this SecretKeyEntry.
-
-
-
Constructor Detail
-
SecretKeyEntry
public SecretKeyEntry(SecretKey secretKey)
Constructs a
SecretKeyEntrywith aSecretKey.- Parameters:
secretKey- theSecretKey- Throws:
NullPointerException- ifsecretKeyisnull
-
SecretKeyEntry
public SecretKeyEntry(SecretKey secretKey, Set<KeyStore.Entry.Attribute> attributes)
Constructs a
SecretKeyEntrywith aSecretKeyand associated entry attributes.The specified
attributesis cloned before it is stored in the newSecretKeyEntryobject.- Parameters:
secretKey- theSecretKeyattributes- the attributes- Throws:
NullPointerException- ifsecretKeyorattributesisnull- Since:
- 1.8
-
-
Method Detail
-
getSecretKey
public SecretKey getSecretKey()
Gets the
SecretKeyfrom this entry.- Returns:
- the
SecretKeyfrom this entry
-
getAttributes
public Set<KeyStore.Entry.Attribute> getAttributes()
Retrieves the attributes associated with an entry.
- Specified by:
getAttributesin interfaceKeyStore.Entry- Returns:
- an unmodifiable
Setof attributes, possibly empty - Since:
- 1.8
-
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.