Package org.apache.kerby.util
Class Util
java.lang.Object
org.apache.kerby.util.Util
- Since:
- 28-Feb-2006
- Author:
- Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcipherToAuthType(String cipher) static booleanTrue if the Keystores have the same # of entries, have the same set of aliases, and all the certificate-chains (of the certificate entries) match.static byte[]fileToBytes(File f) static int[]fill(byte[] buf, int offset, ByteArrayInputStream in) static int[]fill(byte[] buf, int offset, InputStream in) static booleanisWhiteSpace(char c) static booleanstatic voidstatic Stringstatic voidpipeStream(InputStream in, OutputStream out) static voidpipeStream(InputStream in, OutputStream out, boolean autoClose) static byte[]resizeArray(byte[] bytes) static byte[]static byte[]streamToBytes(ByteArrayInputStream in, int maxLength) static byte[]static byte[]streamToBytes(InputStream in, int maxLength) static HostPortstatic InetAddressUtility method to make sure IP-literals don't trigger reverse-DNS lookups.static String
-
Field Details
-
SIZE_KEY
public static final int SIZE_KEY- See Also:
-
LAST_READ_KEY
public static final int LAST_READ_KEY- See Also:
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
equals
True if the Keystores have the same # of entries, have the same set of aliases, and all the certificate-chains (of the certificate entries) match. Does not check the private keys for equality, since we don't bother taking the passwords to get at them.- Parameters:
ks1- The first key storeks2- The second key store- Returns:
- boolean
- Throws:
KeyStoreException- e
-
isYes
-
trim
-
isWhiteSpace
public static boolean isWhiteSpace(char c) -
pipeStream
- Throws:
IOException
-
pipeStream
public static void pipeStream(InputStream in, OutputStream out, boolean autoClose) throws IOException - Throws:
IOException
-
fileToBytes
- Throws:
IOException
-
streamToBytes
-
streamToBytes
- Throws:
IOException
-
streamToBytes
- Throws:
IOException
-
streamToBytes
-
fill
- Throws:
IOException
-
fill
-
resizeArray
public static byte[] resizeArray(byte[] bytes) -
pad
-
toAddress
- Throws:
UnknownHostException
-
cipherToAuthType
-
toInetAddress
Utility method to make sure IP-literals don't trigger reverse-DNS lookups.- Parameters:
s- The string- Returns:
- The InetAddress
- Throws:
UnknownHostException- e
-
main
- Throws:
Exception
-