Search in sources :

Example 26 with Any

use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.

the class Signer method getCreateNftIrisMsg.

public static ArrayList<Any> getCreateNftIrisMsg(String signer, String denomId, String denomName, String id, String name, String uri, String data) {
    ArrayList<Any> msgAnys = new ArrayList<>();
    irismod.nft.Tx.MsgIssueDenom msgIssueDenom = irismod.nft.Tx.MsgIssueDenom.newBuilder().setId(denomId).setName(denomName).setSchema("").setSender(signer).setMintRestricted(false).setUpdateRestricted(false).build();
    Any msgIssueDenomAny = Any.newBuilder().setTypeUrl("/irismod.nft.MsgIssueDenom").setValue(msgIssueDenom.toByteString()).build();
    msgAnys.add(msgIssueDenomAny);
    irismod.nft.Tx.MsgMintNFT msgMintNFT = irismod.nft.Tx.MsgMintNFT.newBuilder().setSender(signer).setRecipient(signer).setId(id).setDenomId(denomId).setName(name).setUri(uri).setData(data).build();
    Any msgMintNftAny = Any.newBuilder().setTypeUrl("/irismod.nft.MsgMintNFT").setValue(msgMintNFT.toByteString()).build();
    msgAnys.add(msgMintNftAny);
    return msgAnys;
}
Also used : Tx(cosmos.gov.v1beta1.Tx) ArrayList(java.util.ArrayList) Any(com.google.protobuf2.Any)

Example 27 with Any

use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.

the class Signer method getCreateNftCroMsg.

public static ArrayList<Any> getCreateNftCroMsg(String signer, String denomId, String denomName, String id, String name, String uri, String data) {
    ArrayList<Any> msgAnys = new ArrayList<>();
    chainmain.nft.v1.Tx.MsgIssueDenom msgIssueDenom = chainmain.nft.v1.Tx.MsgIssueDenom.newBuilder().setId(denomId).setName(denomName).setSchema("").setSender(signer).build();
    Any msgIssueDenomAny = Any.newBuilder().setTypeUrl("/chainmain.nft.v1.MsgIssueDenom").setValue(msgIssueDenom.toByteString()).build();
    msgAnys.add(msgIssueDenomAny);
    chainmain.nft.v1.Tx.MsgMintNFT msgMintNFT = chainmain.nft.v1.Tx.MsgMintNFT.newBuilder().setSender(signer).setRecipient(signer).setId(id).setDenomId(denomId).setName(name).setUri(uri).setData(data).build();
    Any msgMintNftAny = Any.newBuilder().setTypeUrl("/chainmain.nft.v1.MsgMintNFT").setValue(msgMintNFT.toByteString()).build();
    msgAnys.add(msgMintNftAny);
    return msgAnys;
}
Also used : Tx(cosmos.gov.v1beta1.Tx) ArrayList(java.util.ArrayList) Any(com.google.protobuf2.Any)

Example 28 with Any

use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.

the class Signer method getKavaIncentiveHard.

public static Any getKavaIncentiveHard(String sender, ArrayList<kava.incentive.v1beta1.Tx.Selection> denoms_to_claims) {
    kava.incentive.v1beta1.Tx.MsgClaimHardReward msgClaimHardReward = kava.incentive.v1beta1.Tx.MsgClaimHardReward.newBuilder().setSender(sender).addAllDenomsToClaim(denoms_to_claims).build();
    Any msgKavaClaimHardAny = Any.newBuilder().setTypeUrl("/kava.incentive.v1beta1.MsgClaimHardReward").setValue(msgClaimHardReward.toByteString()).build();
    return msgKavaClaimHardAny;
}
Also used : Tx(cosmos.gov.v1beta1.Tx) Any(com.google.protobuf2.Any)

Example 29 with Any

use of com.google.protobuf2.Any in project jss by dogtagpki.

the class CRLDistributionPoint method setCRLIssuer.

/**
 * Sets the CRLIssuer for the CRL at this distribution point.
 * May be set to <code>null</code>.
 *
 * @exception GeneralNamesException If an error occurs encoding the name.
 */
public void setCRLIssuer(GeneralNames CRLIssuer) throws GeneralNamesException, IOException {
    this.CRLIssuer = CRLIssuer;
    if (CRLIssuer != null) {
        // encode the name to catch any problems with it
        DerOutputStream derOut = new DerOutputStream();
        CRLIssuer.encode(derOut);
        try {
            ANY raw = new ANY(derOut.toByteArray());
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            raw.encodeWithAlternateTag(Tag.get(2), bos);
            CRLIssuerEncoding = new ANY(bos.toByteArray());
        } catch (InvalidBERException e) {
            throw new GeneralNamesException(e.toString());
        }
    }
}
Also used : InvalidBERException(org.mozilla.jss.asn1.InvalidBERException) DerOutputStream(org.mozilla.jss.netscape.security.util.DerOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ANY(org.mozilla.jss.asn1.ANY)

Example 30 with Any

use of com.google.protobuf2.Any in project jss by dogtagpki.

the class CRLDistributionPoint method encode.

@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
    SEQUENCE seq = new SEQUENCE();
    DerOutputStream derOut;
    try {
        // is a CHOICE, the [0] tag is forced to be EXPLICIT.
        if (fullName != null) {
            EXPLICIT distPoint = new EXPLICIT(Tag.get(0), fullNameEncoding);
            seq.addElement(distPoint);
        } else if (relativeName != null) {
            derOut = new DerOutputStream();
            relativeName.encode(derOut);
            ANY rn = new ANY(derOut.toByteArray());
            EXPLICIT raw = new EXPLICIT(Tag.get(1), rn);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            raw.encode(bos);
            ANY distPointName = new ANY(bos.toByteArray());
            EXPLICIT distPoint = new EXPLICIT(Tag.get(0), distPointName);
            seq.addElement(distPoint);
        }
        // Encodes the ReasonFlags.
        if (reasons != null) {
            derOut = new DerOutputStream();
            derOut.putUnalignedBitString(reasons);
            ANY raw = new ANY(derOut.toByteArray());
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            raw.encodeWithAlternateTag(Tag.get(1), bos);
            ANY reasonEncoding = new ANY(bos.toByteArray());
            seq.addElement(Tag.get(1), reasonEncoding);
        }
        // Encodes the CRLIssuer
        if (CRLIssuer != null) {
            seq.addElement(Tag.get(2), CRLIssuerEncoding);
        }
        seq.encode(implicitTag, ostream);
    } catch (InvalidBERException e) {
        // the Sun encoding classes
        throw new IOException(e.toString());
    }
}
Also used : InvalidBERException(org.mozilla.jss.asn1.InvalidBERException) DerOutputStream(org.mozilla.jss.netscape.security.util.DerOutputStream) SEQUENCE(org.mozilla.jss.asn1.SEQUENCE) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) ANY(org.mozilla.jss.asn1.ANY) EXPLICIT(org.mozilla.jss.asn1.EXPLICIT)

Aggregations

Any (com.google.protobuf2.Any)17 ANY (org.mozilla.jss.asn1.ANY)16 ArrayList (java.util.ArrayList)13 Tx (cosmos.gov.v1beta1.Tx)11 SET (org.mozilla.jss.asn1.SET)9 InvalidBERException (org.mozilla.jss.asn1.InvalidBERException)8 SEQUENCE (org.mozilla.jss.asn1.SEQUENCE)8 OCTET_STRING (org.mozilla.jss.asn1.OCTET_STRING)7 Attribute (org.mozilla.jss.pkix.primitive.Attribute)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 ASN1Value (org.mozilla.jss.asn1.ASN1Value)6 BMPString (org.mozilla.jss.asn1.BMPString)6 DerOutputStream (org.mozilla.jss.netscape.security.util.DerOutputStream)5 ByteString (com.google.protobuf.ByteString)4 CoinOuterClass (cosmos.base.v1beta1.CoinOuterClass)4 OBJECT_IDENTIFIER (org.mozilla.jss.asn1.OBJECT_IDENTIFIER)4 CryptoToken (org.mozilla.jss.crypto.CryptoToken)4 BufferedInputStream (java.io.BufferedInputStream)3 FileInputStream (java.io.FileInputStream)3 IOException (java.io.IOException)3