当我尝试生成代码时:
Certificate cert;
InputStream path = new FileInputStream(TRUSTSTORE_LOCATION);
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(path, TRUSTSTORE_PASS.toCharArray());
// jak argument podaje sie certyfikat ktory jest zawarty w pliku trustory.jks
cert = ks.getCertificate("xxxx");
binarySecurityTokenElement.addTextNode(new BASE64Encoder().encode(cert.getEncoded()));
//kpg = KeyPairGenerator.getInstance("DSA");
kpg = KeyPairGenerator.getInstance("RSA");
输出是:
<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
Id="X509-7E20D88DE75F0EAADA137595678499810"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">
MIIDXDCCAkSgAwIBAgIEUFbpiDANBgkqhkiG9w0BAQUFADBwMQswCQYDVQQGEwJQTDEQMA4GA1UE
CBMHVW5rbm93bjENMAsGA1UEBxMETG9kejEVMBMGA1UEChMMQU1HLm5ldCBTLkEuMRUwEwYDVQQL
[...]
行尾是这个“ 
;”,如何删除??