示例#1
0
  /**
   * Creates a signer, using specified key values
   *
   * @param publicKeyLocation location of the public key to be included in signed envelopes
   * @param privateKey local location or raw value of private key to be used for encoding
   * @param passPhrase pass phrase for signing with the included private key
   */
  public LRSigner(String publicKeyLocation, String privateKey, String passPhrase) {
    Security.addProvider(new BouncyCastleProvider());

    this.publicKeyLocation = publicKeyLocation;
    this.privateKey = privateKey;
    this.passPhrase = passPhrase;

    passPhrase = LRUtilities.nullifyBadInput(passPhrase);
    publicKeyLocation = LRUtilities.nullifyBadInput(publicKeyLocation);
    privateKey = LRUtilities.nullifyBadInput(privateKey);
  }
 /**
  * Create a new simple documet with specified details
  *
  * @param resourceData value for "resource_data"
  * @param resourceDataType value for "resource_data_type"
  * @param resourceLocator value for "resource_locator"
  * @param curator value for "curator"
  * @param owner value for "owner"
  * @param tags value for "keys"
  * @param payloadPlacement value for "payload_placement"
  * @param payloadSchemaLocator value for "payload_schema_locator"
  * @param payloadSchema value for "payload_schema"
  * @param submitter value for "submitter"
  * @param submitterType value for "submitter_type"
  * @param submissionTOS value for "submission_TOS"
  * @param submissionAttribution value for "submission_attribution"
  * @param signer value for "signer"
  */
 public LRSimpleDocument(
     String resourceData,
     String resourceDataType,
     String resourceLocator,
     String curator,
     String owner,
     String[] tags,
     String payloadPlacement,
     String payloadSchemaLocator,
     String[] payloadSchema,
     String submitter,
     String submitterType,
     String submissionTOS,
     String submissionAttribution,
     String signer) {
   this.resourceData = LRUtilities.nullifyBadInput(LRUtilities.cleanResourceData(resourceData));
   this.resourceDataType = LRUtilities.nullifyBadInput(resourceDataType);
   this.resourceLocator = LRUtilities.nullifyBadInput(resourceLocator);
   this.curator = LRUtilities.nullifyBadInput(curator);
   this.owner = LRUtilities.nullifyBadInput(owner);
   this.tags = LRUtilities.nullifyBadInput(tags);
   this.payloadPlacement = LRUtilities.nullifyBadInput(payloadPlacement);
   this.payloadSchemaLocator = LRUtilities.nullifyBadInput(payloadSchemaLocator);
   this.payloadSchema = LRUtilities.nullifyBadInput(payloadSchema);
   this.submissionTOS = LRUtilities.nullifyBadInput(submissionTOS);
   this.submissionAttribution = LRUtilities.nullifyBadInput(submissionAttribution);
   this.submitterType = LRUtilities.nullifyBadInput(submitterType);
   this.submitter = LRUtilities.nullifyBadInput(submitter);
   this.signer = LRUtilities.nullifyBadInput(signer);
 }