Class AbstractInitLetter
java.lang.Object
org.kopi.ebics.letter.AbstractInitLetter
- All Implemented Interfaces:
InitLetter
- Direct Known Subclasses:
A005Letter, E002Letter, X002Letter
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractInitLetter(Locale locale) Constructs a new initialization letter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuild(String hostId, String bankName, String userId, String username, String partnerId, String version, String certTitle, byte[] certificate, String hashTitle, byte[] hash) Builds an initialization letter.protected static byte[]chunkedBase64(byte[] data) Encodesdataas MIME Base64 (76-character lines separated by CRLF) with a trailing CRLF, matching the historical commons-codecBase64.encodeBase64(data, true)byte-for-byte so PEM-style blocks in the letter keep the-----END CERTIFICATE-----marker on its own line.protected byte[]getHash(byte[] certificate) Returns the SHA-256 hash of the DER-encoded certificate.protected StringReturns the value of the property key.voidwriteTo(OutputStream output) Saves theInitLetterto the given output stream.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InitLetter
create, getName, getTitle
-
Field Details
-
locale
-
messages
-
BUNDLE_NAME
- See Also:
-
-
Constructor Details
-
AbstractInitLetter
Constructs a new initialization letter.- Parameters:
locale- the application locale
-
-
Method Details
-
writeTo
Description copied from interface:InitLetterSaves theInitLetterto the given output stream.- Specified by:
writeToin interfaceInitLetter- Parameters:
output- the output stream.- Throws:
IOException- Save error.
-
build
protected void build(String hostId, String bankName, String userId, String username, String partnerId, String version, String certTitle, byte[] certificate, String hashTitle, byte[] hash) throws IOException Builds an initialization letter.- Parameters:
hostId- the host IDbankName- the bank nameuserId- the user IDusername- the user namepartnerId- the partner IDversion- the signature versioncertTitle- the certificate titlecertificate- the certificate contenthashTitle- the hash titlehash- the hash value- Throws:
IOException
-
getString
-
getHash
Returns the SHA-256 hash of the DER-encoded certificate.- Parameters:
certificate- the DER-encoded certificate- Returns:
- the certificate hash
- Throws:
GeneralSecurityException
-
chunkedBase64
protected static byte[] chunkedBase64(byte[] data) Encodesdataas MIME Base64 (76-character lines separated by CRLF) with a trailing CRLF, matching the historical commons-codecBase64.encodeBase64(data, true)byte-for-byte so PEM-style blocks in the letter keep the-----END CERTIFICATE-----marker on its own line.
-