/** * Represents an element in the P-Mode XML document with type <code>KeyReferenceMethods</code>. Converts the strings * used in the XML document to equivalent value of {@link X509ReferenceType} enumeration. * * @author Sander Fieten (sander at holodeck-b2b.org) */ class KeyReferenceMethod { private static final String ISSUER_SERIAL = "IssuerSerial"; private static final String BST_REFERENCE = "BSTReference"; private static final String SKI = "KeyIdentifier"; @Text String referenceMethod = null; X509ReferenceType getRefMethod() { if (BST_REFERENCE.equals(referenceMethod)) return X509ReferenceType.BSTReference; else if (SKI.equals(referenceMethod)) return X509ReferenceType.KeyIdentifier; else return X509ReferenceType.IssuerAndSerial; } }
/** * Represents the password element with type attribute */ static class Password { @Text(required = true) private String value; @Attribute(required = false) private String type = "Digest"; }
/** * Represents a <code>KeystoreAlias</code> element in the P-Mode XML document that contains a reference to a certificate * in one of the keystores. The reference consists of at least the alias that is used to identify the certificate in the * keystore and optionally a password to access the private key from the certificate. * * @author Sander Fieten (sander at holodeck-b2b.org) */ class KeystoreAlias { @Text String name = null; @Attribute(required = false) String password = null; }
/** * Represents the configuration for the <b>PMode.id</b> parameter. * * @author Sander Fieten (sander at holodeck-b2b.org) * @author Bram Bakx (bram at holodeck-b2b.org) */ class PModeId { /** * Identifies the PMode uniquely */ @Text String id; /** * Specifies if the PMode ID should be included in the actual message */ @Attribute(required = false) Boolean include = false; }
public class FailureModel { @Attribute public String message; @Attribute public String type; @Text public String text; }
@Root private static class Header { @Attribute private String name; @Text private String value; private String getName(){ return name; } public void append(StringBuilder builder){ builder.append(name).append(": ").append(value).append("\r\n"); } }
public class FailureModel { @Attribute public String message; @Attribute public String type; @Text public String text; }
@Text private String name;
@Root private static class Expect{ @Attribute private String name; @Text private String value; public void check(Map<String, String> response) { String text = response.get(name); if(value == null) { throw new IllegalStateException("Response does not contain header '"+name+"'"); } if(!value.equals(text)) { throw new IllegalStateException("Response header value '"+text+"' does not match expectation '"+value+"'"); } } } }
@Text private String id;
public static class Namespace { @Attribute private int key ; @Attribute(name="case") private String caseRule ; @Text(required=false) private String name ; public int getKey() { return key; } public String getCaseRule() { return caseRule; } public String getName() { if (name == null) return "" ; else return name; } }
@Text private String value;
@Text private String text;
@Text(required = false) private String name;
public class PartyId implements IPartyId { @Text private String id;
private static final long serialVersionUID = 3028041532565616921L; @Text private String value;
private static final long serialVersionUID = -6656266954109936292L; @Text private String value;
private String message; @Text private String value;
private String contentType; @Text(required = false) private String link;
@Root(name="Value") public static class Value { public Value(){ this(""); } public Value(String text) { this.text = text; this._protected = false; } public Value(String text, Boolean _protected) { this._protected = _protected; this.text = text; } @Attribute(name = "ProtectInMemory", required = false) @Convert(KeePassBooleanConverter.class) // NB converters don't work on attributes -see KdbxOutputTransformer protected Boolean protectInMemory; @Attribute(name = "Protected", required = false) @Convert(KeePassBooleanConverter.class) // NB converters don't work on attributes -see KdbxOutputTransformer Boolean _protected; @Text String text; public void setProtected(boolean aProtected) { this._protected = aProtected; } } }