org.xipki.ca.gateway.acme.AcmeAuthz Maven / Gradle / Ivy
// Copyright (c) 2013-2023 xipki. All rights reserved.
// License Apache License 2.0
package org.xipki.ca.gateway.acme;
import org.xipki.ca.gateway.acme.msg.AuthzResponse;
import org.xipki.ca.gateway.acme.msg.ChallengeResponse;
import org.xipki.ca.gateway.acme.type.AuthzStatus;
import org.xipki.util.Args;
import org.xipki.util.CompareUtil;
import org.xipki.util.JSON;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* @author Lijun Liao (xipki)
*/
public class AcmeAuthz {
private final int subId;
private final AcmeIdentifier identifier;
private AuthzStatus status;
private Instant expires;
private List challenges;
private AcmeOrder order;
public AcmeAuthz(int subId, AcmeIdentifier identifier) {
this.subId = Args.notNull(subId, "subId");
this.identifier = Args.notNull(identifier, "identifier");
}
public Map encode() {
Map map = new HashMap<>();
map.put("subId", subId);
map.put("identifier", identifier.encode());
if (status != null) {
map.put("status", status.name());
}
if (expires != null) {
map.put("expires", expires.getEpochSecond());
}
if (challenges != null) {
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy